: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { APP_METRICS_OUTPUT, LOG_ENTRIES_OUTPUT } from '~/common/outputs'
import { IngestionOutputsBuilder } from '~/common/outputs/ingestion-outputs-builder'
import { LOGS_DLQ_OUTPUT, LOGS_OUTPUT } from './outputs'
/**
* Outputs for the logs ingestion deployment.
*
* - `LOGS_OUTPUT` — main log data path → topic from `LOGS_INGESTION_CONSUMER_CLICKHOUSE_TOPIC`.
* - `LOGS_DLQ_OUTPUT` — DLQ for failed messages → topic from `LOGS_INGESTION_CONSUMER_DLQ_TOPIC`.
* - `APP_METRICS_OUTPUT` — usage metrics → topic from `LOGS_INGESTION_OUTPUT_APP_METRICS_TOPIC`.
* - `LOG_ENTRIES_OUTPUT` — hog function logs (UI log viewer) → topic from `LOGS_INGESTION_OUTPUT_LOG_ENTRIES_TOPIC`.
*
* Per-output producer is env-controlled (`*_PRODUCER` keys) so the route can be
* flipped between MSK / Warpstream-logs / Warpstream-ingestion without code changes.
*/
export function createLogsOutputsRegistry() {
return new IngestionOutputsBuilder()
.register(APP_METRICS_OUTPUT, {
topicKey: 'LOGS_INGESTION_OUTPUT_APP_METRICS_TOPIC',
producerKey: 'LOGS_INGESTION_OUTPUT_APP_METRICS_PRODUCER',
})
.register(LOG_ENTRIES_OUTPUT, {
topicKey: 'LOGS_INGESTION_OUTPUT_LOG_ENTRIES_TOPIC',
producerKey: 'LOGS_INGESTION_OUTPUT_LOG_ENTRIES_PRODUCER',
})
.register(LOGS_OUTPUT, {
topicKey: 'LOGS_INGESTION_CONSUMER_CLICKHOUSE_TOPIC',
producerKey: 'LOGS_INGESTION_OUTPUT_LOGS_PRODUCER',
})
.register(LOGS_DLQ_OUTPUT, {
topicKey: 'LOGS_INGESTION_CONSUMER_DLQ_TOPIC',
producerKey: 'LOGS_INGESTION_OUTPUT_DLQ_PRODUCER',
})
}
/**
* Outputs for the traces ingestion deployment. Mirrors `createLogsOutputsRegistry`
* but reads topic names from the traces-prefixed env vars so a single deployment
* type produces to the trace-specific topics.
*/
export function createTracesOutputsRegistry() {
return new IngestionOutputsBuilder()
.register(APP_METRICS_OUTPUT, {
topicKey: 'LOGS_INGESTION_OUTPUT_APP_METRICS_TOPIC',
producerKey: 'LOGS_INGESTION_OUTPUT_APP_METRICS_PRODUCER',
})
.register(LOG_ENTRIES_OUTPUT, {
topicKey: 'LOGS_INGESTION_OUTPUT_LOG_ENTRIES_TOPIC',
producerKey: 'LOGS_INGESTION_OUTPUT_LOG_ENTRIES_PRODUCER',
})
.register(LOGS_OUTPUT, {
topicKey: 'TRACES_INGESTION_CONSUMER_CLICKHOUSE_TOPIC',
producerKey: 'LOGS_INGESTION_OUTPUT_LOGS_PRODUCER',
})
.register(LOGS_DLQ_OUTPUT, {
topicKey: 'TRACES_INGESTION_CONSUMER_DLQ_TOPIC',
producerKey: 'LOGS_INGESTION_OUTPUT_DLQ_PRODUCER',
})
}