Skip to content

Connect PostHog

Run self-hosted PostHog on a Kafka cluster over TLS.

Updated View as Markdown

Self-hosted PostHog ingests events through Kafka. Its Rust services, such as property-defs-rs, cymbal and feature-flags, connect over TLS without a username and password, so they use the cluster’s unauthenticated access on port 9091. Its other services can use a user over SASL_SSL as well.

Before you start

  • A Kafka cluster (4.3 or later). Topics are created automatically by default (autoCreateTopics).
  • Unauthenticated access turned on with readWrite access, on the cluster’s Configuration tab or with ezgh hosted-queues clusters update <cluster> --unauthenticated-access readWrite. Only the cluster’s allowed sources and firewall peers reach port 9091.
  • The CA bundle where PostHog’s services run.

Settings

Give PostHog’s Rust services every broker’s name on port 9091, and turn TLS on:

KAFKA_HOSTS=b0-kafka-….us-west-1.ezghcompute.com:9091,b1-kafka-….us-west-1.ezghcompute.com:9091,b2-kafka-….us-west-1.ezghcompute.com:9091
KAFKA_TLS=true

The cluster’s Connectivity tab, and ezgh hosted-queues clusters get, list the brokers’ names.

Topics

PostHog’s installer creates its topics with one partition and a replication factor of 1. They’re listed on the cluster’s Topics tab, as Created by app, and the cluster keeps them as created. On a replicated cluster, raise them to three copies so they keep serving when a node is out of service: Raise to 3 copies on the Topics tab, or ezgh hosted-queues clusters raise-replication <cluster>. See Topics and consumer groups.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close