PostHog / posthog

🦔 PostHog provides open-source web & product analytics, session recording, feature flagging and A/B testing that you can self-host. Get started - free.
https://posthog.com
Other
22.05k stars 1.33k forks source link

chore: use posthog single-shard cluster for distributed_events_recent #26339

Closed Daesgar closed 43 minutes ago

Daesgar commented 23 hours ago

Problem

The current table reads from the default cluster, which contains two (US) or eight (EU) shards. Since the events_recent table is not sharded, reading from distributed_events_recent duplicates results.

We want to use a distributed table to hit replicas with low lag (the setting needs to be configured yet).

Changes

Use the posthog_single_shard cluster.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

Yes! Updated the Docker ClickHouse config file so it creates a the new cluster.