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.

chore(nodejs): move ingestion producer registry out of common (#65427)

José Sequeira1a2b05598aa2
diff --git a/nodejs/src/common/outputs/index.ts b/nodejs/src/common/outputs/index.ts
index 87cedcaa3c18..0ad6dd6b0681 100644
--- a/nodejs/src/common/outputs/index.ts
+++ b/nodejs/src/common/outputs/index.ts
@@ -34,27 +34,3 @@ export type TophogOutput = typeof TOPHOG_OUTPUT
export const HOG_INVOCATION_RESULTS_OUTPUT = 'hog_invocation_results' as const
export type HogInvocationResultsOutput = typeof HOG_INVOCATION_RESULTS_OUTPUT
-
-// Producer names
-//
-// A producer name is a named Kafka connection slot, not a fixed cluster: the code declares the
-// slots, and each pipeline's Helm charts wire a slot to a concrete cluster (broker list +
-// security protocol) and route its outputs to it. A slot can map to different clusters in
-// different pipelines. The slot → cluster mapping lives in the charts repo
-// (shared/ingestion/common*.yaml, argocd/ingestion/config/*.yaml).
-//
-// Cluster-accurate slots:
-// INGESTION_UPSTREAM — dedicated ingestion cluster; re-consumed topics (overflow/async/dlq)
-// INGESTION_DOWNSTREAM — warpstream-ingestion cluster; ClickHouse-bound outputs
-// Pipeline-specific slots (e.g. session replay's warpstream-replay producer) live in their own module.
-
-/** UPSTREAM — dedicated ingestion cluster; re-consumed topics (overflow/async/dlq). */
-export const INGESTION_UPSTREAM_PRODUCER = 'INGESTION_UPSTREAM' as const
-export type IngestionUpstreamProducer = typeof INGESTION_UPSTREAM_PRODUCER
-
-/** DOWNSTREAM — warpstream-ingestion cluster; ClickHouse-bound outputs. */
-export const INGESTION_DOWNSTREAM_PRODUCER = 'INGESTION_DOWNSTREAM' as const
-export type IngestionDownstreamProducer = typeof INGESTION_DOWNSTREAM_PRODUCER
-
-/** Union of all known producer names. Extend this as new producers are added. */
-export type ProducerName = IngestionUpstreamProducer | IngestionDownstreamProducer
diff --git a/nodejs/src/common/personhog/index.ts b/nodejs/src/common/personhog/index.ts
index 42e3c32656b0..4fab8af90799 100644
--- a/nodejs/src/common/personhog/index.ts
+++ b/nodejs/src/common/personhog/index.ts
@@ -1,6 +1,6 @@
+import type { CommonConfig } from '~/common/config'
import { GroupRepository } from '~/common/groups/repositories/group-repository.interface'
import { PersonRepository } from '~/common/persons/repositories/person-repository'
-import { PersonHogConfig } from '~/ingestion/config'
import { logger } from '~/utils/logger'
import { PersonHogClient, parseRolloutTeamIds } from './client'
@@ -12,6 +12,27 @@ export type { PersonHogClientConfig } from './client'
export { PersonHogGroupRepository } from './personhog-group-repository'
export { PersonHogPersonRepository } from './personhog-person-repository'
+/** PersonHog gRPC client config */
+export type PersonHogConfig = Pick<
+ CommonConfig,
+ | 'PERSONHOG_ENABLED'
+ | 'PERSONHOG_ADDR'
+ | 'PERSONHOG_GROUPS_ROLLOUT_PERCENTAGE'
+ | 'PERSONHOG_GROUPS_ROLLOUT_TEAM_IDS'
+ | 'PERSONHOG_PERSONS_ROLLOUT_PERCENTAGE'
+ | 'PERSONHOG_PERSONS_ROLLOUT_TEAM_IDS'
+ | 'PERSONHOG_TLS'
+ | 'PERSONHOG_TIMEOUT_MS'
+ | 'PERSONHOG_READ_MAX_BYTES'
+ | 'PERSONHOG_WRITE_MAX_BYTES'
+ | 'PERSONHOG_PING_INTERVAL_MS'
+ | 'PERSONHOG_PING_TIMEOUT_MS'
+ | 'PERSONHOG_PING_IDLE_CONNECTION'
+ | 'PERSONHOG_IDLE_CONNECTION_TIMEOUT_MS'
+ | 'PERSONHOG_STATE_MONITOR_POLL_INTERVAL_MS'
+ | 'PLUGIN_SERVER_MODE'
+>
+
export function createPersonHogClient(config: PersonHogConfig): PersonHogClient | null {
if (!config.PERSONHOG_ENABLED || !config.PERSONHOG_ADDR) {
return null
diff --git a/nodejs/src/config/redis-pools.ts b/nodejs/src/config/redis-pools.ts
index a9e5cbab9171..29911bc19df3 100644
--- a/nodejs/src/config/redis-pools.ts
+++ b/nodejs/src/config/redis-pools.ts
@@ -1,5 +1,4 @@
import { CommonConfig } from '../common/config'
-import { IngestionConsumerConfig } from '../ingestion/config'
import { RedisConnectionConfig } from '../utils/db/redis'
/**
@@ -51,6 +50,18 @@ export function createPosthogRedisConnectionConfig(
return { url: config.REDIS_URL, name: 'posthog-redis' }
}
+/** Cookieless Redis connection params — COOKIELESS_REDIS_* are ingestion-specific config keys. */
+export type CookielessRedisConfig = {
+ COOKIELESS_REDIS_HOST: string
+ COOKIELESS_REDIS_PORT: number
+}
+
+/** $feature_flag_called dedup Redis connection params — these are ingestion-specific config keys. */
+export type FeatureFlagCalledDedupRedisConfig = {
+ INGESTION_FEATURE_FLAG_CALLED_DEDUP_REDIS_HOST: string
+ INGESTION_FEATURE_FLAG_CALLED_DEDUP_REDIS_PORT: number
+}
+
/**
* Build the connection config for the $feature_flag_called dedup Redis pool.
*
@@ -59,10 +70,7 @@ export function createPosthogRedisConnectionConfig(
* INGESTION_FEATURE_FLAG_CALLED_DEDUP_REDIS_HOST points at the dedicated instance.
*/
export function createFeatureFlagCalledDedupRedisConnectionConfig(
- config: Pick<
- IngestionConsumerConfig,
- 'INGESTION_FEATURE_FLAG_CALLED_DEDUP_REDIS_HOST' | 'INGESTION_FEATURE_FLAG_CALLED_DEDUP_REDIS_PORT'
- > &
+ config: FeatureFlagCalledDedupRedisConfig &
Pick<
CommonConfig,
| 'INGESTION_REDIS_HOST'
@@ -88,8 +96,7 @@ export function createFeatureFlagCalledDedupRedisConnectionConfig(
* Fallback chain: COOKIELESS_REDIS_HOST → REDIS_URL
*/
export function createCookielessRedisConnectionConfig(
- config: Pick<IngestionConsumerConfig, 'COOKIELESS_REDIS_HOST' | 'COOKIELESS_REDIS_PORT'> &
- Pick<CommonConfig, 'REDIS_URL'>
+ config: CookielessRedisConfig & Pick<CommonConfig, 'REDIS_URL'>
): RedisConnectionConfig {
if (config.COOKIELESS_REDIS_HOST) {
return {
diff --git a/nodejs/src/common/outputs/registry.ts b/nodejs/src/ingestion/common/producer-registry.ts
similarity index 84%
rename from nodejs/src/common/outputs/registry.ts
rename to nodejs/src/ingestion/common/producer-registry.ts
index d986c51a693a..7e4bafd6cf75 100644
--- a/nodejs/src/common/outputs/registry.ts
+++ b/nodejs/src/ingestion/common/producer-registry.ts
@@ -1,11 +1,13 @@
-import { INGESTION_DOWNSTREAM_PRODUCER, INGESTION_UPSTREAM_PRODUCER, ProducerName } from '.'
-
import { KafkaProducerRegistry } from '~/common/outputs/kafka-producer-registry'
import { KafkaProducerRegistryBuilder } from '~/common/outputs/kafka-producer-registry-builder'
+
import {
+ INGESTION_DOWNSTREAM_PRODUCER,
INGESTION_DOWNSTREAM_PRODUCER_CONFIG_MAP,
+ INGESTION_UPSTREAM_PRODUCER,
INGESTION_UPSTREAM_PRODUCER_CONFIG_MAP,
-} from '~/ingestion/common/config'
+ ProducerName,
+} from './producers'
/**
* The consolidated UPSTREAM/DOWNSTREAM producer slots, for the analytics-family servers
@@ -13,6 +15,10 @@ import {
* charts — an unconfigured slot falls through to the schema-default broker (`kafka:9092`),
* which is reachable in dev/hobby but not in prod, so a missing wire fails fast there.
* Session replay composes its own set instead.
+ *
+ * Lives in its own module (not producers.ts) so that importing the producer slot
+ * names/maps — which config files do at module-eval time — does not transitively pull in
+ * the Kafka producer machinery (and the logger → defaultConfig cycle behind it).
*/
export function createIngestionProducerRegistry(kafkaClientRack: string | undefined) {
return new KafkaProducerRegistryBuilder(kafkaClientRack)
diff --git a/nodejs/src/ingestion/common/config.ts b/nodejs/src/ingestion/common/producers.ts
similarity index 83%
rename from nodejs/src/ingestion/common/config.ts
rename to nodejs/src/ingestion/common/producers.ts
index 0ea24d36072e..a07e753de8ba 100644
--- a/nodejs/src/ingestion/common/config.ts
+++ b/nodejs/src/ingestion/common/producers.ts
@@ -1,8 +1,31 @@
import type { AllowedConfigKey } from '~/common/outputs/kafka-producer-config'
+// Producer names
+//
+// A producer name is a named Kafka connection slot, not a fixed cluster: the code declares the
+// slots, and each pipeline's Helm charts wire a slot to a concrete cluster (broker list +
+// security protocol) and route its outputs to it. A slot can map to different clusters in
+// different pipelines. The slot → cluster mapping lives in the charts repo
+// (shared/ingestion/common*.yaml, argocd/ingestion/config/*.yaml).
+//
+// Cluster-accurate slots:
+// INGESTION_UPSTREAM — dedicated ingestion cluster; re-consumed topics (overflow/async/dlq)
+// INGESTION_DOWNSTREAM — warpstream-ingestion cluster; ClickHouse-bound outputs
+// Pipeline-specific slots (e.g. session replay's warpstream-replay producer) live in their own module.
+
+/** UPSTREAM — dedicated ingestion cluster; re-consumed topics (overflow/async/dlq). */
+export const INGESTION_UPSTREAM_PRODUCER = 'INGESTION_UPSTREAM' as const
+export type IngestionUpstreamProducer = typeof INGESTION_UPSTREAM_PRODUCER
+
+/** DOWNSTREAM — warpstream-ingestion cluster; ClickHouse-bound outputs. */
+export const INGESTION_DOWNSTREAM_PRODUCER = 'INGESTION_DOWNSTREAM' as const
+export type IngestionDownstreamProducer = typeof INGESTION_DOWNSTREAM_PRODUCER
+
+/** Union of all known producer names. Extend this as new producers are added. */
+export type ProducerName = IngestionUpstreamProducer | IngestionDownstreamProducer
+
// =============================================================================
-// Cluster-accurate producer slots: INGESTION_UPSTREAM / INGESTION_DOWNSTREAM
-// (see common/outputs/index.ts for the slot contract).
+// Cluster-accurate producer slots: env-var maps and their default env config.
// =============================================================================
/** UPSTREAM — dedicated ingestion cluster (re-consumed topics); ssl + sasl auth. */
diff --git a/nodejs/src/ingestion/config.ts b/nodejs/src/ingestion/config.ts
index c13e4b51e866..d678ffcc5ad9 100644
--- a/nodejs/src/ingestion/config.ts
+++ b/nodejs/src/ingestion/config.ts
@@ -1,5 +1,4 @@
import type { CommonConfig } from '~/common/config'
-import { INGESTION_DOWNSTREAM_PRODUCER, INGESTION_UPSTREAM_PRODUCER, type ProducerName } from '~/common/outputs'
import {
KAFKA_APP_METRICS_2,
KAFKA_CLICKHOUSE_AI_EVENTS_JSON,
@@ -16,6 +15,11 @@ import {
KAFKA_PERSON,
KAFKA_PERSON_DISTINCT_ID,
} from '~/config/kafka-topics'
+import {
+ INGESTION_DOWNSTREAM_PRODUCER,
+ INGESTION_UPSTREAM_PRODUCER,
+ type ProducerName,
+} from '~/ingestion/common/producers'
import type { PostgresRouterConfig } from '~/utils/db/postgres'
import { isDevEnv, isProdEnv } from '~/utils/env-utils'
@@ -58,27 +62,6 @@ export type RedisConnectionsConfig = Pick<
| 'POSTHOG_REDIS_PASSWORD'
>
-/** PersonHog gRPC client config */
-export type PersonHogConfig = Pick<
- CommonConfig,
- | 'PERSONHOG_ENABLED'
- | 'PERSONHOG_ADDR'
- | 'PERSONHOG_GROUPS_ROLLOUT_PERCENTAGE'
- | 'PERSONHOG_GROUPS_ROLLOUT_TEAM_IDS'
- | 'PERSONHOG_PERSONS_ROLLOUT_PERCENTAGE'
- | 'PERSONHOG_PERSONS_ROLLOUT_TEAM_IDS'
- | 'PERSONHOG_TLS'
- | 'PERSONHOG_TIMEOUT_MS'
- | 'PERSONHOG_READ_MAX_BYTES'
- | 'PERSONHOG_WRITE_MAX_BYTES'
- | 'PERSONHOG_PING_INTERVAL_MS'
- | 'PERSONHOG_PING_TIMEOUT_MS'
- | 'PERSONHOG_PING_IDLE_CONNECTION'
- | 'PERSONHOG_IDLE_CONNECTION_TIMEOUT_MS'
- | 'PERSONHOG_STATE_MONITOR_POLL_INTERVAL_MS'
- | 'PLUGIN_SERVER_MODE'
->
-
/** Kafka consumer loop tuning config */
export type KafkaConsumerBaseConfig = Pick<
CommonConfig,
diff --git a/nodejs/src/ingestion/pipelines/clientwarnings/consumer.test.ts b/nodejs/src/ingestion/pipelines/clientwarnings/consumer.test.ts
index ee4371c6f289..6583aff987ee 100644
--- a/nodejs/src/ingestion/pipelines/clientwarnings/consumer.test.ts
+++ b/nodejs/src/ingestion/pipelines/clientwarnings/consumer.test.ts
@@ -1,5 +1,5 @@
-import { ProducerName } from '~/common/outputs'
import { KafkaProducerRegistry } from '~/common/outputs/kafka-producer-registry'
+import { ProducerName } from '~/ingestion/common/producers'
import { newScope } from '~/ingestion/common/scopes'
import { IngestionOutputsConfig } from '~/ingestion/config'
import { RedisPool } from '~/types'
diff --git a/nodejs/src/ingestion/pipelines/clientwarnings/consumer.ts b/nodejs/src/ingestion/pipelines/clientwarnings/consumer.ts
index 02c3740dcd47..18b8de9d9c4d 100644
--- a/nodejs/src/ingestion/pipelines/clientwarnings/consumer.ts
+++ b/nodejs/src/ingestion/pipelines/clientwarnings/consumer.ts
@@ -1,8 +1,8 @@
-import { ProducerName } from '~/common/outputs'
import { IngestionOutputsComponent } from '~/common/outputs/ingestion-outputs'
import { KafkaProducerRegistry } from '~/common/outputs/kafka-producer-registry'
import { EventFilterManagerComponent } from '~/ingestion/common/event-filters'
import { CommonIngestionConsumerConfig, CommonIngestionConsumerScope } from '~/ingestion/common/ingestion-consumer'
+import { ProducerName } from '~/ingestion/common/producers'
import { Scope, extend } from '~/ingestion/common/scopes'
import { PromiseSchedulerComponent } from '~/ingestion/common/utils/promise-scheduler'
import { IngestionConsumerConfig, IngestionOutputsConfig } from '~/ingestion/config'
diff --git a/nodejs/src/ingestion/pipelines/errortracking/config.ts b/nodejs/src/ingestion/pipelines/errortracking/config.ts
index f672cd707301..f2c5e987ec53 100644
--- a/nodejs/src/ingestion/pipelines/errortracking/config.ts
+++ b/nodejs/src/ingestion/pipelines/errortracking/config.ts
@@ -1,4 +1,3 @@
-import { INGESTION_DOWNSTREAM_PRODUCER, INGESTION_UPSTREAM_PRODUCER, type ProducerName } from '~/common/outputs'
import {
KAFKA_APP_METRICS_2,
KAFKA_CLICKHOUSE_TOPHOG,
@@ -9,6 +8,11 @@ import {
KAFKA_INGESTION_WARNINGS,
KAFKA_LOG_ENTRIES,
} from '~/config/kafka-topics'
+import {
+ INGESTION_DOWNSTREAM_PRODUCER,
+ INGESTION_UPSTREAM_PRODUCER,
+ type ProducerName,
+} from '~/ingestion/common/producers'
import { IngestionLane } from '~/ingestion/config'
export type ErrorTrackingConsumerConfig = {
diff --git a/nodejs/src/ingestion/pipelines/heatmaps/consumer.test.ts b/nodejs/src/ingestion/pipelines/heatmaps/consumer.test.ts
index d9eaf499a0df..8f3a0d7822f4 100644
--- a/nodejs/src/ingestion/pipelines/heatmaps/consumer.test.ts
+++ b/nodejs/src/ingestion/pipelines/heatmaps/consumer.test.ts
@@ -1,6 +1,6 @@
-import { ProducerName } from '~/common/outputs'
import { KafkaProducerRegistry } from '~/common/outputs/kafka-producer-registry'
import { CookielessManager } from '~/ingestion/common/cookieless/cookieless-manager'
+import { ProducerName } from '~/ingestion/common/producers'
import { newScope } from '~/ingestion/common/scopes'
import { IngestionOutputsConfig } from '~/ingestion/config'
import { RedisPool } from '~/types'
diff --git a/nodejs/src/ingestion/pipelines/heatmaps/consumer.ts b/nodejs/src/ingestion/pipelines/heatmaps/consumer.ts
index d1e01489d80b..8656c765c6c4 100644
--- a/nodejs/src/ingestion/pipelines/heatmaps/consumer.ts
+++ b/nodejs/src/ingestion/pipelines/heatmaps/consumer.ts
@@ -1,9 +1,9 @@
-import { ProducerName } from '~/common/outputs'
import { IngestionOutputsComponent } from '~/common/outputs/ingestion-outputs'
import { KafkaProducerRegistry } from '~/common/outputs/kafka-producer-registry'
import { CookielessManager } from '~/ingestion/common/cookieless/cookieless-manager'
import { EventFilterManagerComponent } from '~/ingestion/common/event-filters'
import { CommonIngestionConsumerConfig, CommonIngestionConsumerScope } from '~/ingestion/common/ingestion-consumer'
+import { ProducerName } from '~/ingestion/common/producers'
import { Scope, extend } from '~/ingestion/common/scopes'
import { PromiseSchedulerComponent } from '~/ingestion/common/utils/promise-scheduler'
import { IngestionConsumerConfig, IngestionOutputsConfig } from '~/ingestion/config'
diff --git a/nodejs/src/ingestion/pipelines/sessionreplay/config.ts b/nodejs/src/ingestion/pipelines/sessionreplay/config.ts
index e5e2d4dd8363..5ef612a6b072 100644
--- a/nodejs/src/ingestion/pipelines/sessionreplay/config.ts
+++ b/nodejs/src/ingestion/pipelines/sessionreplay/config.ts
@@ -1,5 +1,4 @@
import { getDefaultClickhouseConfig } from '~/common/clickhouse-config'
-import { INGESTION_DOWNSTREAM_PRODUCER, type IngestionDownstreamProducer } from '~/common/outputs'
import {
KAFKA_CLICKHOUSE_SESSION_REPLAY_EVENTS,
KAFKA_CLICKHOUSE_SESSION_REPLAY_FEATURES,
@@ -10,6 +9,7 @@ import {
KAFKA_SESSION_RECORDING_SNAPSHOT_ITEM_EVENTS,
KAFKA_SESSION_RECORDING_SNAPSHOT_ITEM_OVERFLOW,
} from '~/config/kafka-topics'
+import { INGESTION_DOWNSTREAM_PRODUCER, type IngestionDownstreamProducer } from '~/ingestion/common/producers'
import {
INGESTION_SESSIONREPLAY_PRODUCER,
type IngestionSessionreplayProducer,
diff --git a/nodejs/src/ingestion/pipelines/sessionreplay/outputs/producer-registry.ts b/nodejs/src/ingestion/pipelines/sessionreplay/outputs/producer-registry.ts
index 2eb6062344d2..0b00da3110c9 100644
--- a/nodejs/src/ingestion/pipelines/sessionreplay/outputs/producer-registry.ts
+++ b/nodejs/src/ingestion/pipelines/sessionreplay/outputs/producer-registry.ts
@@ -1,6 +1,5 @@
-import { INGESTION_DOWNSTREAM_PRODUCER } from '~/common/outputs'
import { KafkaProducerRegistryBuilder } from '~/common/outputs/kafka-producer-registry-builder'
-import { INGESTION_DOWNSTREAM_PRODUCER_CONFIG_MAP } from '~/ingestion/common/config'
+import { INGESTION_DOWNSTREAM_PRODUCER, INGESTION_DOWNSTREAM_PRODUCER_CONFIG_MAP } from '~/ingestion/common/producers'
import {
INGESTION_SESSIONREPLAY_PRODUCER,
INGESTION_SESSIONREPLAY_PRODUCER_CONFIG_MAP,
diff --git a/nodejs/src/servers/error-tracking-server.ts b/nodejs/src/servers/error-tracking-server.ts
index 672e5a631cab..252bcbac59b6 100644
--- a/nodejs/src/servers/error-tracking-server.ts
+++ b/nodejs/src/servers/error-tracking-server.ts
@@ -1,12 +1,18 @@
import { IntegrationManagerService } from '~/cdp/services/managers/integration-manager.service'
import { ReadOnlyGroupTypeManager } from '~/common/groups/readonly-group-type-manager'
-import { ProducerName } from '~/common/outputs'
import { KafkaProducerRegistry } from '~/common/outputs/kafka-producer-registry'
-import { createIngestionProducerRegistry } from '~/common/outputs/registry'
-import { createPersonHogClient } from '~/common/personhog'
+import { PersonHogConfig, createPersonHogClient } from '~/common/personhog'
import { PersonHogGroupReadRepository } from '~/common/personhog/personhog-group-read-repository'
import { PersonHogPersonReadRepository } from '~/common/personhog/personhog-person-read-repository'
import { CookielessManager, CookielessServerConfig } from '~/ingestion/common/cookieless/cookieless-manager'
+import { createIngestionProducerRegistry } from '~/ingestion/common/producer-registry'
+import {
+ KafkaDownstreamProducerEnvConfig,
+ KafkaUpstreamProducerEnvConfig,
+ ProducerName,
+ getDefaultKafkaDownstreamProducerEnvConfig,
+ getDefaultKafkaUpstreamProducerEnvConfig,
+} from '~/ingestion/common/producers'
import {
ErrorTrackingConsumerConfig,
ErrorTrackingOutputsConfig,
@@ -25,17 +31,10 @@ import { EncryptedFields } from '../cdp/utils/encryption-utils'
import { CommonConfig } from '../common/config'
import { defaultConfig, overrideConfigWithEnv } from '../config/config'
import { createCookielessRedisConnectionConfig, createIngestionRedisConnectionConfig } from '../config/redis-pools'
-import {
- KafkaDownstreamProducerEnvConfig,
- KafkaUpstreamProducerEnvConfig,
- getDefaultKafkaDownstreamProducerEnvConfig,
- getDefaultKafkaUpstreamProducerEnvConfig,
-} from '../ingestion/common/config'
import {
DatabaseConnectionConfig,
KafkaBrokerConfig,
KafkaConsumerBaseConfig,
- PersonHogConfig,
RedisConnectionsConfig,
} from '../ingestion/config'
import { PluginServerService, RedisPool } from '../types'
diff --git a/nodejs/src/servers/ingestion-api-server.ts b/nodejs/src/servers/ingestion-api-server.ts
index 76603c88052e..333c7a1a34d8 100644
--- a/nodejs/src/servers/ingestion-api-server.ts
+++ b/nodejs/src/servers/ingestion-api-server.ts
@@ -5,15 +5,21 @@ import { IntegrationManagerService } from '~/cdp/services/managers/integration-m
import { GroupTypeManager } from '~/common/groups/group-type-manager'
import { ClickhouseGroupRepository } from '~/common/groups/repositories/clickhouse-group-repository'
import { PostgresGroupRepository } from '~/common/groups/repositories/postgres-group-repository'
-import { ProducerName } from '~/common/outputs'
import { KafkaProducerRegistry } from '~/common/outputs/kafka-producer-registry'
-import { createIngestionProducerRegistry } from '~/common/outputs/registry'
-import { buildGroupRepository, buildPersonRepository, createPersonHogClient } from '~/common/personhog'
+import { PersonHogConfig, buildGroupRepository, buildPersonRepository, createPersonHogClient } from '~/common/personhog'
import { PostgresPersonRepository } from '~/common/persons/repositories/postgres-person-repository'
import { CookielessManager } from '~/ingestion/common/cookieless/cookieless-manager'
import { BatchWritingGroupStore } from '~/ingestion/common/groups/batch-writing-group-store'
import { BatchWritingPersonsStore } from '~/ingestion/common/persons/batch-writing-person-store'
import { PersonsStore } from '~/ingestion/common/persons/persons-store'
+import { createIngestionProducerRegistry } from '~/ingestion/common/producer-registry'
+import {
+ KafkaDownstreamProducerEnvConfig,
+ KafkaUpstreamProducerEnvConfig,
+ ProducerName,
+ getDefaultKafkaDownstreamProducerEnvConfig,
+ getDefaultKafkaUpstreamProducerEnvConfig,
+} from '~/ingestion/common/producers'
import { parseSplitAiEventsConfig } from '~/ingestion/common/steps/event-processing/split-ai-events-step'
import { createOkContext } from '~/ingestion/framework/helpers'
import { TopHog } from '~/ingestion/framework/tophog'
@@ -44,12 +50,6 @@ import {
} from '../config/redis-pools'
import { deserializeKafkaMessage } from '../ingestion/api/kafka-message-converter'
import { IngestBatchRequest, IngestBatchResponse } from '../ingestion/api/types'
-import {
- KafkaDownstreamProducerEnvConfig,
- KafkaUpstreamProducerEnvConfig,
- getDefaultKafkaDownstreamProducerEnvConfig,
- getDefaultKafkaUpstreamProducerEnvConfig,
-} from '../ingestion/common/config'
import { EventFilterManagerComponent } from '../ingestion/common/event-filters'
import {
DatabaseConnectionConfig,
@@ -57,7 +57,6 @@ import {
IngestionOutputsConfig,
KafkaBrokerConfig,
KafkaConsumerBaseConfig,
- PersonHogConfig,
RedisConnectionsConfig,
getDefaultIngestionOutputsConfig,
} from '../ingestion/config'
diff --git a/nodejs/src/servers/ingestion-general-server.ts b/nodejs/src/servers/ingestion-general-server.ts
index 0468ce3c71a9..03cb7155b786 100644
--- a/nodejs/src/servers/ingestion-general-server.ts
+++ b/nodejs/src/servers/ingestion-general-server.ts
@@ -2,10 +2,16 @@ import { IntegrationManagerService } from '~/cdp/services/managers/integration-m
import { GroupTypeManager } from '~/common/groups/group-type-manager'
import { ClickhouseGroupRepository } from '~/common/groups/repositories/clickhouse-group-repository'
import { PostgresGroupRepository } from '~/common/groups/repositories/postgres-group-repository'
-import { KafkaProducerRegistryComponent } from '~/common/outputs/registry'
-import { buildGroupRepository, buildPersonRepository, createPersonHogClient } from '~/common/personhog'
+import { PersonHogConfig, buildGroupRepository, buildPersonRepository, createPersonHogClient } from '~/common/personhog'
import { PostgresPersonRepository } from '~/common/persons/repositories/postgres-person-repository'
import { CookielessManagerComponent } from '~/ingestion/common/cookieless/cookieless-manager'
+import { KafkaProducerRegistryComponent } from '~/ingestion/common/producer-registry'
+import {
+ KafkaDownstreamProducerEnvConfig,
+ KafkaUpstreamProducerEnvConfig,
+ getDefaultKafkaDownstreamProducerEnvConfig,
+ getDefaultKafkaUpstreamProducerEnvConfig,
+} from '~/ingestion/common/producers'
import { createAiEventSubpipeline } from '~/ingestion/pipelines/ai'
import { createOutputsRegistry } from '~/ingestion/pipelines/analytics/outputs/registry'
import { createClientWarningsConsumer } from '~/ingestion/pipelines/clientwarnings'
@@ -30,12 +36,6 @@ import {
createFeatureFlagCalledDedupRedisConnectionConfig,
createIngestionRedisConnectionConfig,
} from '../config/redis-pools'
-import {
- KafkaDownstreamProducerEnvConfig,
- KafkaUpstreamProducerEnvConfig,
- getDefaultKafkaDownstreamProducerEnvConfig,
- getDefaultKafkaUpstreamProducerEnvConfig,
-} from '../ingestion/common/config'
import { ingestionConsumerService } from '../ingestion/common/ingestion-consumer'
import { extend, newScope } from '../ingestion/common/scopes'
import {
@@ -44,7 +44,6 @@ import {
IngestionOutputsConfig,
KafkaBrokerConfig,
KafkaConsumerBaseConfig,
- PersonHogConfig,
RedisConnectionsConfig,
getDefaultIngestionOutputsConfig,
} from '../ingestion/config'
diff --git a/nodejs/src/servers/ingestion-session-replay-server.ts b/nodejs/src/servers/ingestion-session-replay-server.ts
index a3a54d6adbd5..f849b3d52e0c 100644
--- a/nodejs/src/servers/ingestion-session-replay-server.ts
+++ b/nodejs/src/servers/ingestion-session-replay-server.ts
@@ -1,4 +1,8 @@
import { KafkaProducerRegistry } from '~/common/outputs/kafka-producer-registry'
+import {
+ KafkaDownstreamProducerEnvConfig,
+ getDefaultKafkaDownstreamProducerEnvConfig,
+} from '~/ingestion/common/producers'
import {
SessionReplayOutputsConfig,
type SessionReplayProducerName,
@@ -15,10 +19,6 @@ import {
import { initializePrometheusLabels } from '../api/router'
import { CommonConfig } from '../common/config'
import { defaultConfig, overrideConfigWithEnv } from '../config/config'
-import {
- KafkaDownstreamProducerEnvConfig,
- getDefaultKafkaDownstreamProducerEnvConfig,
-} from '../ingestion/common/config'
import { KafkaBrokerConfig, RedisConnectionsConfig } from '../ingestion/config'
import { RedisPool } from '../types'
import { PostgresRouter, PostgresRouterConfig } from '../utils/db/postgres'
diff --git a/nodejs/tests/ingestion/pipelines/clientwarnings/consumer-e2e.test.ts b/nodejs/tests/ingestion/pipelines/clientwarnings/consumer-e2e.test.ts
index 1d16e7f6b9ae..3e9fe4023b93 100644
--- a/nodejs/tests/ingestion/pipelines/clientwarnings/consumer-e2e.test.ts
+++ b/nodejs/tests/ingestion/pipelines/clientwarnings/consumer-e2e.test.ts
@@ -1,10 +1,10 @@
import { Message } from 'node-rdkafka'
-import { KafkaProducerRegistryComponent } from '~/common/outputs/registry'
+import { KafkaProducerRegistryComponent } from '~/ingestion/common/producer-registry'
import {
getDefaultKafkaDownstreamProducerEnvConfig,
getDefaultKafkaUpstreamProducerEnvConfig,
-} from '~/ingestion/common/config'
+} from '~/ingestion/common/producers'
import { Component, newScope } from '~/ingestion/common/scopes'
import { getDefaultIngestionOutputsConfig } from '~/ingestion/config'
import {
diff --git a/nodejs/tests/ingestion/pipelines/heatmaps/consumer-e2e.test.ts b/nodejs/tests/ingestion/pipelines/heatmaps/consumer-e2e.test.ts
index ac8c1657f394..3faf58d111eb 100644
--- a/nodejs/tests/ingestion/pipelines/heatmaps/consumer-e2e.test.ts
+++ b/nodejs/tests/ingestion/pipelines/heatmaps/consumer-e2e.test.ts
@@ -1,11 +1,11 @@
import { Message } from 'node-rdkafka'
-import { KafkaProducerRegistryComponent } from '~/common/outputs/registry'
+import { CookielessManagerComponent } from '~/ingestion/common/cookieless/cookieless-manager'
+import { KafkaProducerRegistryComponent } from '~/ingestion/common/producer-registry'
import {
getDefaultKafkaDownstreamProducerEnvConfig,
getDefaultKafkaUpstreamProducerEnvConfig,
-} from '~/ingestion/common/config'
-import { CookielessManagerComponent } from '~/ingestion/common/cookieless/cookieless-manager'
+} from '~/ingestion/common/producers'
import { Component, newScope } from '~/ingestion/common/scopes'
import { getDefaultIngestionOutputsConfig } from '~/ingestion/config'
import {