fix(ingestion): pre-create combined consumer output topics in kafka-init#60883
Merged
Conversation
The combined analytics ingestion consumer checks topic existence at startup for every output it produces to. Redpanda auto-creates topics only on producer-first writes, so on a fresh stack the outputs no other service writes to first (clickhouse_groups, clickhouse_person_distinct_id, log_entries, clickhouse_tophog, ...) are missing and the check fails. Pre-create the full output set in kafka-init for both dev and hobby.
Contributor
|
Reviews (1): Last reviewed commit: "fix(ingestion): pre-create combined cons..." | Re-trigger Greptile |
Contributor
|
🎭 Playwright report · View test results →
These issues are not necessarily caused by your changes. |
Contributor
❌ Hobby deploy smoke test: FAILEDFailing fast because: Container health check failed Unhealthy containers:
Run 26753991975 | Consecutive failures: 1 |
lucasheriques
approved these changes
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a fresh dev or hobby stack, the combined analytics ingestion consumer (
INGESTION-V2-COMBINED) fails its startup health check with repeated errors like:The consumer checks topic existence at startup for every output it produces to (
nodejs/src/ingestion/analytics/outputs/registry.ts, verified innodejs/src/ingestion/outputs/single-ingestion-output.ts). Redpanda'sauto_create_topics_enabledonly fires on a producer-first write, so the output topics that no other service writes to first don't exist when the check runs, and startup fails.The
kafka-initservices pre-created only a single topic each (document_embeddings_inputin dev,clickhouse_events_jsonin hobby), which is why most topics happened to exist (created by other producers) but these four did not.Changes
Expanded the
kafka-initpre-create loop in bothdocker-compose.dev.ymlanddocker-compose.hobby.ymlto cover the full set of output topics the combined consumer checks at startup:clickhouse_events_json,clickhouse_ai_events_json,clickhouse_heatmap_eventsclickhouse_ingestion_warnings,clickhouse_app_metrics2events_plugin_ingestion_dlq/_overflow/_asyncclickhouse_groups,clickhouse_person,clickhouse_person_distinct_idlog_entries,clickhouse_tophogThe loop is idempotent — existing topics are skipped — so pre-creating topics that other producers normally create first is harmless.
How did you test this code?
I'm an agent. I validated both compose files parse with
docker compose -f <file> configafter the change (and confirmed the YAML block-scalar shell loop survivedhogli format:yaml). I did not spin up a full stack to observe the consumer starting cleanly.🤖 Agent context
Authored with Claude Code (Opus 4.8). Traced the failing log line to
single-ingestion-output.ts, enumerated the required output topics fromanalytics/outputs/registry.tsand their default values innodejs/src/ingestion/config.ts, then mapped them to literal topic names vianodejs/src/config/kafka-topics.ts(no prefix/suffix in dev/hobby). Chose to pre-create the full output set rather than only the four observed failures, since any of them can be missing depending on fresh-environment ordering.