Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(ingestion): pre-create combined consumer output topics in kafka-init (#60883)

Paweł Ledwoń7e8d6c738c52
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
index 3a6e6b5a0be8..5820ed2ef454 100644
--- a/docker-compose.dev.yml
+++ b/docker-compose.dev.yml
@@ -465,7 +465,24 @@ services:
exit 1
fi
done
- for topic in document_embeddings_input; do
+ # The combined analytics ingestion consumer checks topic existence at
+ # startup for every output it produces to (see analytics/outputs/registry.ts).
+ # Auto-create only fires on producer-first writes, so pre-create them here.
+ TOPICS="document_embeddings_input \
+ clickhouse_events_json \
+ clickhouse_ai_events_json \
+ clickhouse_heatmap_events \
+ clickhouse_ingestion_warnings \
+ events_plugin_ingestion_dlq \
+ events_plugin_ingestion_overflow \
+ events_plugin_ingestion_async \
+ clickhouse_groups \
+ clickhouse_person \
+ clickhouse_person_distinct_id \
+ clickhouse_app_metrics2 \
+ log_entries \
+ clickhouse_tophog"
+ for topic in $$TOPICS; do
if rpk topic create "$$topic" --brokers kafka:9092 -p 1 -r 1 2>&1; then
echo "Topic $$topic created"
elif rpk topic list --brokers kafka:9092 | grep -q "$$topic"; then
diff --git a/docker-compose.hobby.yml b/docker-compose.hobby.yml
index 4044ef32924a..3e0d5422a19b 100644
--- a/docker-compose.hobby.yml
+++ b/docker-compose.hobby.yml
@@ -514,9 +514,25 @@ services:
fi
done
echo "Kafka broker is accepting requests, creating topics..."
- # Create topics needed by rust services
+ # Create topics needed by rust services and the combined analytics ingestion
+ # consumer, which checks topic existence at startup for every output it produces
+ # to (see analytics/outputs/registry.ts). Auto-create only fires on producer-first
+ # writes, so pre-create them here.
# Note: $$ escapes $ for docker-compose variable substitution
- for topic in clickhouse_events_json; do
+ TOPICS="clickhouse_events_json \
+ clickhouse_ai_events_json \
+ clickhouse_heatmap_events \
+ clickhouse_ingestion_warnings \
+ events_plugin_ingestion_dlq \
+ events_plugin_ingestion_overflow \
+ events_plugin_ingestion_async \
+ clickhouse_groups \
+ clickhouse_person \
+ clickhouse_person_distinct_id \
+ clickhouse_app_metrics2 \
+ log_entries \
+ clickhouse_tophog"
+ for topic in $$TOPICS; do
if rpk topic create "$$topic" --brokers kafka:9092 -p 1 -r 1 2>&1; then
echo "Topic $$topic created successfully"
else