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(session-replay): set prometheus default labels at server start (#58810)

Paweł Ledwońfa62d50d5c9a
diff --git a/nodejs/src/servers/ingestion-session-replay-server.ts b/nodejs/src/servers/ingestion-session-replay-server.ts
index d254f980de6b..221894ccb510 100644
--- a/nodejs/src/servers/ingestion-session-replay-server.ts
+++ b/nodejs/src/servers/ingestion-session-replay-server.ts
@@ -1,3 +1,4 @@
+import { initializePrometheusLabels } from '../api/router'
import { CommonConfig } from '../common/config'
import { defaultConfig, overrideConfigWithEnv } from '../config/config'
import {
@@ -86,6 +87,8 @@ export class IngestionSessionReplayServer implements NodeServer {
}
private async startServices(): Promise<void> {
+ initializePrometheusLabels(this.config.INGESTION_PIPELINE, this.config.INGESTION_LANE)
+
this.postgres = new PostgresRouter(this.config, this.config.PLUGIN_SERVER_MODE ?? undefined)
logger.info('👍', 'Postgres Router ready')