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(ingestion): update agent monitoring skills now that we're on golden charts/WS (#58184)

Eli Reisman19e0da4511fb
diff --git a/.agents/skills/monitoring-capture-service/SKILL.md b/.agents/skills/monitoring-capture-service/SKILL.md
index 458792aa8bdf..d09b43a25cc0 100644
--- a/.agents/skills/monitoring-capture-service/SKILL.md
+++ b/.agents/skills/monitoring-capture-service/SKILL.md
@@ -11,7 +11,7 @@ description: >
The capture service (`rust/capture/`) is PostHog's Rust HTTP ingestion endpoint.
It receives events from SDKs, applies quota/rate limits, and produces to Kafka.
-Three deployment roles run the same binary with different `CAPTURE_MODE` configs.
+Five deployments run the same binary with different `CAPTURE_MODE` configs, each in its own K8s namespace.
This skill teaches how to **discover live metrics** using the Grafana MCP tools
rather than memorizing metric names that change as the code evolves.
@@ -41,7 +41,7 @@ Each has a Grafana datasource and a discovery entry point.
| App metrics (VictoriaMetrics) | `victoriametrics` | `list_prometheus_metric_names` | `regex: "capture_.*"` |
| App metrics (realtime) | `victoriametrics-realtime` | same | same (lower retention, higher resolution) |
| Logs | `P44D702D3E93867EC` (Loki-logs) | `list_loki_label_names` | `app=~"capture.*"` |
-| Profiling | `pyroscope` | `list_pyroscope_profile_types` | `service_name="capture/capture"` |
+| Profiling | `pyroscope` | `list_pyroscope_profile_types` | `service_name="capture-analytics/capture-analytics"` |
| Dashboards | n/a | `search_dashboards` | query `"capture"` or `"ingestion"` |
| CloudWatch (ElastiCache, MSK) | `P034F075C744B399F` | `query_prometheus` | `environment="prod-us"` |
| CloudWatch Root (prod-us only) | `PAAE47F430CFD1449` | same | root account AWS metrics (does NOT exist in prod-eu) |
@@ -52,18 +52,22 @@ These facts change infrequently and are hard to discover dynamically.
### Deployment roles
-The `role` label on all `capture_*` and `http_requests_*` metrics distinguishes pipelines:
+Each capture variant runs as a **separate K8s deployment in its own namespace**.
+The primary scope labels are `namespace` and `container` (not `role` — that label
+contains pod names and is not useful for filtering).
-| Role | Pipeline | Notes |
-| ---------------- | ------------------ | --------------------------- |
-| `capture` | Main events | Highest volume |
-| `capture-ai` | AI/LLM events | OTel ingestion on port 4318 |
-| `capture-replay` | Session recordings | `CAPTURE_MODE=recordings` |
+| Deployment | Namespace | `capture_mode` | Pipeline | Notes |
+| ------------------- | ------------------- | -------------- | ------------------ | --------------------------------------------- |
+| `capture-analytics` | `capture-analytics` | `events` | Main events | Highest volume; routes `/e`, `/i/v0/e`, etc. |
+| `capture-ai` | `capture-ai` | `events` | AI/LLM events | Routes `/i/v0/ai`; OTel on port 4318 |
+| `capture-replay` | `capture-replay` | `recordings` | Session recordings | Routes `/s/`; `CAPTURE_MODE=recordings` |
+| `capture-mirrored` | `capture-mirrored` | `events` | Mirror/canary | Not always running; same metrics as analytics |
+| `capture-logs` | `capture-logs` | — | Log ingestion | OTel logs on port 4318 |
-`capture-logs` is a **separate deployment** (not a `role` value on capture metrics).
-It exists in both prod-us and prod-eu. Pyroscope service names follow the same
-`{namespace}/{deployment}` pattern in both envs: `capture/capture`, `capture/capture-ai`,
-`capture-replay/capture-replay`, `capture-logs/capture-logs`.
+All variants share the same Rust binary (`ghcr.io/posthog/posthog/capture`).
+
+Scope capture metrics with `namespace=~"capture-.*"` or `container=~"capture-.*"`.
+For a single pipeline, scope by `namespace` (e.g., `namespace="capture-analytics"`).
### Envoy cluster naming
@@ -71,10 +75,13 @@ Envoy metrics use `envoy_cluster_name` to identify the upstream backend.
Pattern: `posthog_{deployment}_{port}`.
Capture-related clusters:
-`posthog_capture_3000`, `posthog_capture-ai_3000`, `posthog_capture-replay_3000`,
-`posthog_capture-replay-canary_3000`, `posthog_capture-logs_4318`, `posthog_capture-logs-canary_4318`.
+`posthog_capture-analytics_3000`, `posthog_capture-ai_3000`, `posthog_capture-replay_3000`,
+`posthog_capture-mirrored_3000`, `posthog_capture-logs_4318`, `posthog_capture-logs-canary_4318`.
+
+capture-replay also has a proxy-as-a-service cluster used in KEDA autoscaling:
+`proxy-as-a-service_capture-replay_3000`.
-Scope with: `envoy_cluster_name=~"posthog_capture.*"`.
+Scope with: `envoy_cluster_name=~"posthog_capture-.*"`.
### Redis instance topology
@@ -86,6 +93,7 @@ metrics and CloudWatch ElastiCache metrics.
**1. Primary Redis** (`REDIS_URL` env var)
- ElastiCache: `posthog-solo` (prod-us) or `posthog-prod-redis-encripted` (prod-eu; sic — typo in actual cluster name)
+- Both envs use a **read-only** endpoint for the token cache (`REDIS_READER_URL`)
- Backs: billing/quota limits (`CaptureQuotaLimiter`), session replay overflow limiter
- Capture metrics: `capture_billing_limits_loaded_tokens` (by `cache_key`),
`capture_quota_limit_exceeded` (by `resource`)
@@ -98,12 +106,13 @@ metrics and CloudWatch ElastiCache metrics.
- Backs: per-(token, distinct_id) sliding-window rate limiter
- Falls back to primary Redis when URL is unset
- Optional read replica: `GLOBAL_RATE_LIMIT_REDIS_READER_URL`
-- Code defines `global_rate_limiter_*` metrics but they are **not currently emitting**
- in VictoriaMetrics. Best proxy signal: `capture_events_rerouted_overflow{reason="rate_limited"}`
+- Toggle: `GLOBAL_RATE_LIMIT_ENABLED` (may be off in some envs during rollout)
+- Metrics: `global_rate_limiter_*` (direct), `capture_events_rerouted_overflow{reason="rate_limited"}` (proxy signal)
- CloudWatch cluster id: `capture-globalratelimit-prod-redis`
-**3. Event Restrictions Redis** (`EVENT_RESTRICTIONS_REDIS_URL`, optional)
+**3. Event Restrictions Redis** (`EVENT_RESTRICTIONS_REDIS_URL`)
+- ElastiCache: `ingestion-prod-redis` (separate writable cluster in both envs)
- Stores Django-synced ingestion restriction configs
- Falls back to primary Redis when URL is unset
- Capture metrics: `capture_event_restrictions_redis_fetch` (labels: `restriction_type`,
@@ -120,44 +129,55 @@ metrics and CloudWatch ElastiCache metrics.
Every prefix here can be discovered live with `list_prometheus_metric_names`
using `datasourceUid: "victoriametrics"` and `regex: "<prefix>.*"`.
-| Prefix | Domain | Scope label |
-| ------------------------------ | --------------------------------------- | ----------------------------------------- |
-| `capture_*` | App metrics (68 metrics) | `role` |
-| `http_requests_*` | HTTP layer (shared) | `role=~"capture.*"` |
-| `capture_kafka_*` | Kafka producer (17 metrics) | `role` |
-| `capture_billing_*` | Billing/quota tokens loaded | `role`, `cache_key` |
-| `capture_event_restrictions_*` | Event restrictions (6 metrics) | `role`, `restriction_type` |
-| `capture_ai_otel_*` | AI/OTel capture (7 metrics) | `role="capture-ai"` |
-| `envoy_cluster_*` | L7 proxy | `envoy_cluster_name=~"posthog_capture.*"` |
-| `aws_msk_*` | MSK broker-side (JMX) | `environment="prod-us"` |
-| `ratelimit_service_*` | Contour rate limit | `domain="posthog"` |
-| `overflow_redirect_*` | Node.js ingestion overflow (downstream) | `ingestion_pipeline` |
-| `kube_*` / `container_*` | K8s resources | `namespace="posthog"`, `pod=~"capture.*"` |
+| Prefix | Domain | Scope label |
+| ------------------------------ | --------------------------------------- | ---------------------------------------------- |
+| `capture_*` | App metrics (~80 metrics) | `namespace`, `container` |
+| `http_requests_*` | HTTP layer (shared) | `namespace=~"capture-.*"` |
+| `capture_kafka_*` | Kafka producer (17 metrics) | `namespace`, `container` |
+| `capture_billing_*` | Billing/quota tokens loaded | `namespace`, `cache_key` |
+| `capture_event_restrictions_*` | Event restrictions (6 metrics) | `namespace`, `restriction_type` |
+| `capture_ai_otel_*` | AI/OTel capture (12 metrics) | `namespace="capture-ai"` |
+| `envoy_cluster_*` | L7 proxy | `envoy_cluster_name=~"posthog_capture-.*"` |
+| `aws_msk_*` | MSK broker-side (JMX) | `environment="prod-us"` or `"prod-eu"` |
+| `ratelimit_service_*` | Contour rate limit | `domain="posthog"` |
+| `overflow_redirect_*` | Node.js ingestion overflow (downstream) | `ingestion_pipeline` |
+| `kube_*` / `container_*` | K8s resources | `namespace=~"capture-.*"`, `pod=~"capture-.*"` |
### Kafka topics
-Topics capture produces to (discover live via `topic` label on `capture_kafka_produce_avg_batch_size_bytes`):
-
-| Topic | Pipeline |
-| ----------------------------------- | -------------------------------------------- |
-| `ingestion-events-1024` | Main events |
-| `ingestion-events-overflow-128` | Overflow (rate-limited / high-volume tokens) |
-| `ingestion-events-historical-128` | Historical backfill events |
-| `ingestion-session_replay-main-256` | Session replay |
-| `ingestion-heatmaps-128` | Heatmaps |
-| `ingestion-logs` | Log ingestion |
-| `ingestion-general-turbo-1024` | General turbo |
-| `ingestion-errortracking-main-128` | Error tracking |
-| `client_iwarnings_ingestion` | Client warnings |
+Topics capture produces to (discover live via `topic` label on `capture_kafka_produce_avg_batch_size_bytes`).
+Partition counts are encoded in topic names and **differ by env** (EU generally has fewer partitions).
+
+Capture writes to **two different Kafka backing systems** depending on the pipeline:
+
+- **MSK ingestion cluster** — analytics events (main, overflow, historical, turbo), heatmaps, error tracking, client warnings
+- **WarpStream** — session replay (`warpstream-replay-v2` VC), logs (`warpstream-logs` VC), traces (`warpstream-traces` VC)
+
+| Topic (prod-us / prod-eu) | Backing | Pipeline |
+| ---------------------------------------------------------- | ---------- | -------------------------------------------- |
+| `ingestion-analytics-main-1024` / `-512` | MSK | Main events |
+| `ingestion-analytics-overflow-128` | MSK | Overflow (rate-limited / high-volume tokens) |
+| `ingestion-analytics-historical-128` | MSK | Historical backfill events |
+| `ingestion-analytics-turbo-1024` | MSK | General turbo (prod-us only) |
+| `ingestion-heatmaps-main-128` | MSK | Heatmaps |
+| `ingestion-errortracking-main-128` | MSK | Error tracking |
+| `ingestion-errortracking-overflow-32` | MSK | Error tracking overflow |
+| `ingestion-clientwarnings-main-16` / `-32` | MSK | Client warnings |
+| `ingestion-sessionreplay-main-512` / `-256` | WarpStream | Session replay |
+| `ingestion-sessionreplay-overflow-64` / `-32` | WarpStream | Session replay overflow |
+| `ingestion-logs` | WarpStream | Log ingestion |
+| `ingestion-traces` | WarpStream | Traces ingestion |
+| `ingestion-analytics-main-dlq` (+ per-pipeline DLQ topics) | MSK | Dead letter queues |
### Pyroscope services
-| Service name | Deployment |
-| ------------------------------- | -------------- |
-| `capture/capture` | Main capture |
-| `capture/capture-ai` | AI capture |
-| `capture-replay/capture-replay` | Replay capture |
-| `capture-logs/capture-logs` | Logs capture |
+| Service name | Deployment |
+| ------------------------------------- | ---------------------------- |
+| `capture-analytics/capture-analytics` | Main capture |
+| `capture-ai/capture-ai` | AI capture |
+| `capture-replay/capture-replay` | Replay capture |
+| `capture-mirrored/capture-mirrored` | Mirror/canary (when running) |
+| `capture-logs/capture-logs` | Logs capture |
Profile types: `process_cpu:cpu:nanoseconds:cpu:nanoseconds`,
`wall:wall:nanoseconds:wall:nanoseconds`,
@@ -166,18 +186,19 @@ Profile types: `process_cpu:cpu:nanoseconds:cpu:nanoseconds`,
### Grafana dashboards
-| UID | Title |
-| -------------------------------------- | -------------------------------------------------------------- |
-| `capture` | Main capture dashboard |
-| `ingestion-capture` | Capture-specific ingestion metrics |
-| `ingestion-general` | Cross-service ingestion overview |
-| `ingestion-reliability` | Error rates and reliability signals |
-| `ingestion-pipeline-performance` | End-to-end pipeline latency |
-| `b2348f37-f276-498e-b72e-7cc2b5ec1455` | New capture dashboard |
-| `contour` | Envoy L7 proxy (set `envoy_cluster_name=posthog_capture_3000`) |
-| `envoy-contour-debug` | Envoy/Contour debugging |
-| `qZz6iq9Wx` | AWS MSK Kafka Cluster |
-| `ingestion-session-recordings` | Session Replay ingestion |
+| UID | Title |
+| -------------------------------------- | ------------------------------------------------------------------------ |
+| `capture` | Capture (golden-chart backend overview) |
+| `ddfkdj56ds11xce` | Capture Golden (Synced folder) |
+| `dffkdlee8ub5s0a` | Ingestion - Capture Golden |
+| `capture-3000-envoy-codes` | Capture 3000 — Envoy Response Code Investigation |
+| `ingestion-general` | Cross-service ingestion overview |
+| `ingestion-analytics` | Ingestion - Analytics (per-pipeline breakdown) |
+| `ingestion-reliability` | Error rates and reliability signals |
+| `ingestion-pipeline-performance` | End-to-end pipeline latency |
+| `b2348f37-f276-498e-b72e-7cc2b5ec1455` | New capture (legacy) |
+| `contour` | Envoy L7 proxy (set `envoy_cluster_name=posthog_capture-analytics_3000`) |
+| `ingestion-session-recordings` | Session Replay ingestion |
## Discovery workflows
@@ -187,7 +208,7 @@ Profile types: `process_cpu:cpu:nanoseconds:cpu:nanoseconds`,
2. Pick a metric, then `list_prometheus_label_names` scoped to it — see available dimensions
3. `list_prometheus_label_values` — discover actual values for a label
(e.g. `labelName: "cause"` on `capture_events_dropped_total`)
-4. `query_prometheus` with PromQL — always scope by `role` and set a time range
+4. `query_prometheus` with PromQL — always scope by `namespace` (or `container`) and set a time range
### Loki (logs)
@@ -198,7 +219,7 @@ Profile types: `process_cpu:cpu:nanoseconds:cpu:nanoseconds`,
### Pyroscope (profiling)
1. `list_pyroscope_profile_types` — `data_source_uid: "pyroscope"`
-2. `fetch_pyroscope_profile` — `matchers: '{service_name="capture/capture"}'`,
+2. `fetch_pyroscope_profile` — `matchers: '{service_name="capture-analytics/capture-analytics"}'`,
`profile_type: "process_cpu:cpu:nanoseconds:cpu:nanoseconds"`
### Dashboards
@@ -220,13 +241,16 @@ Profile types: `process_cpu:cpu:nanoseconds:cpu:nanoseconds`,
Categories of what to look for. Discover specific metrics live using the prefixes above.
**HTTP layer** — request rate, latency distribution (p50/p99), active connections,
-error rates by status code. Metrics: `http_requests_*` scoped by `role`, `capture_active_connections`.
+error rates by status code. Metrics: `http_requests_*` scoped by `namespace`, `capture_active_connections`.
**Event lifecycle** — the funnel from received to ingested to dropped/rerouted.
`capture_events_received_total` -> `capture_events_ingested_total` -> `capture_events_dropped_total`.
-The `cause` label on drops has 16 values (discover live).
+The `cause` label on drops has 20+ values (discover live). Key additions since the golden-chart
+migration: `event_restriction_drop`, `event_too_big`, `otel_quota_drop`, `oversize_event`,
+`ai_opt_in`, `gathering`, `invalid_session`, `no_session_id`, `no_snapshot`.
Rerouting: `capture_events_rerouted_overflow` with `reason` label
(`rate_limited`, `force_limited`, `event_restriction`).
+Also: `capture_events_rerouted_custom_topic` for topic-redirect restrictions.
**Kafka producer** — broker connectivity (`capture_kafka_any_brokers_down`,
`capture_kafka_broker_connected`), queue saturation (`_queue_depth` / `_queue_depth_limit`),
@@ -242,17 +266,27 @@ staleness, loaded count, applied restrictions by `restriction_type`
**Envoy proxy** — upstream latency, response codes (2xx/4xx/5xx), connection health,
circuit breakers (`_open` gauges), backend membership (healthy vs total),
-timeouts, retries. Always filter: `envoy_cluster_name=~"posthog_capture.*"`.
+timeouts, retries. Always filter: `envoy_cluster_name=~"posthog_capture-.*"`.
+For capture-replay, also check `proxy-as-a-service_capture-replay_3000`.
**Contour rate limit** — `ratelimit_service_*` for per-IP DoS protection.
`ratelimit_service_rate_limit_over_limit` = actively rate-limited IPs.
-**MSK broker-side** — `aws_msk_*` JMX metrics. Key signals: throttle time,
-network processor idle %, memory pool depletion, request queue size.
-Scope: `environment="prod-us"` or `"prod-eu"`.
+**MSK broker-side** — `aws_msk_*` JMX metrics for capture-analytics, capture-ai, and other MSK-backed topics.
+Key signals: throttle time, network processor idle %, memory pool depletion, request queue size.
+Both envs have a **dedicated ingestion MSK** cluster separate from the events cluster
+(prod-us: c21; prod-eu: `posthog-prod-eu-ingestion-2026-05-04`).
+
+**WarpStream** — `warpstream_agent_*` metrics for capture-replay, capture-logs, and traces.
+These pipelines produce to in-cluster WarpStream agents, not MSK.
+Key signals: `warpstream_agent_control_plane_operation_counter` (by `operation`),
+`warpstream_agent_file_cache_client_fetch_local_or_remote_counter` (cache hit/miss ratio).
+Dashboards: `warpstream` (Agent Overview), `dbfj5c31spa1ogf` (MSK vs WarpStream — Active Produce Topics).
+US-only personal dashboards (not synced to EU): `ws-coarse-lag-explore` (Coarse Lag), `8e93b023-…` (CH Consumer Lag).
+Per-VC KMinion instances: `kminion-warpstream-replay`, `kminion-warpstream-logs`, `kminion-warpstream-traces`.
**K8s resources** — `container_*` and `kube_*` for CPU, memory, restarts, HPA state.
-Scope: `namespace="posthog"`, `pod=~"capture.*"`.
+Scope: `namespace=~"capture-.*"`, `pod=~"capture-.*"`.
## Investigation playbooks
diff --git a/.agents/skills/monitoring-capture-service/references/investigation-playbooks.md b/.agents/skills/monitoring-capture-service/references/investigation-playbooks.md
index 640273fdcc0e..3b603582abdf 100644
--- a/.agents/skills/monitoring-capture-service/references/investigation-playbooks.md
+++ b/.agents/skills/monitoring-capture-service/references/investigation-playbooks.md
@@ -11,13 +11,13 @@ Start by pulling up the main dashboard:
Then verify these signals in order:
-1. **HTTP error rate** — `http_requests_duration_seconds_count` by `status`, role-scoped.
+1. **HTTP error rate** — `http_requests_duration_seconds_count` by `status`, scoped by `namespace`.
Any sustained 5xx spike is the top-priority signal.
2. **Kafka connectivity** — `capture_kafka_any_brokers_down`. Value of 1 on any pod is critical.
3. **Event acceptance ratio** — `rate(capture_events_ingested_total)` / `rate(capture_events_received_total)`.
Sustained drop below ~0.95 warrants investigation.
4. **Envoy backend health** — `envoy_cluster_membership_healthy` vs `envoy_cluster_membership_total`
- for `envoy_cluster_name=~"posthog_capture.*"`. Ratio < 1.0 outside of deploys is a problem.
+ for `envoy_cluster_name=~"posthog_capture-.*"`. Ratio < 1.0 outside of deploys is a problem.
5. **Event restrictions staleness** — `capture_event_restrictions_stale` gauge.
Value of 1 means restrictions aren't being refreshed from Redis.
6. **Billing limits loaded** — `capture_billing_limits_loaded_tokens` by `cache_key`.
@@ -50,13 +50,13 @@ The event funnel: received -> ingested -> dropped/rerouted.
Diagnose layer by layer, outside-in:
1. **Envoy layer** — `envoy_cluster_upstream_rq_time_bucket` histogram for
- `envoy_cluster_name=~"posthog_capture.*"`.
+ `envoy_cluster_name=~"posthog_capture-.*"`.
Compute p99 with `histogram_quantile(0.99, ...)`.
If Envoy latency is high but HTTP handler latency is normal, the issue is between Envoy and the pod (networking, connection pool).
-2. **HTTP handler** — `http_requests_duration_seconds_bucket` scoped by `role`.
+2. **HTTP handler** — `http_requests_duration_seconds_bucket` scoped by `namespace`.
This is the end-to-end request latency inside the capture binary.
- Compare p99 across roles to isolate which pipeline is slow.
+ Compare p99 across namespaces to isolate which pipeline is slow.
3. **Kafka produce RTT** — `capture_kafka_produce_rtt_latency_us` by `broker` and `quantile`.
p99 > 100ms sustained = broker overload or network issues.
@@ -106,9 +106,8 @@ Multiple layers of rate limiting can affect capture. Check in this order:
`redirect_to_topic` = reroute to custom topic, `skip_person_processing` = pass through but skip person
3. **Global rate limiter** (per-token+distinct_id, Redis-backed)
- - Code defines `global_rate_limiter_*` metrics but they may not be active.
- Check `list_prometheus_metric_names` regex `"global_rate_limiter.*"` first.
- - Proxy signal: `capture_events_rerouted_overflow{reason="rate_limited"}` rate.
+ - `global_rate_limiter_*` metrics for direct limiter decisions.
+ - `capture_events_rerouted_overflow{reason="rate_limited"}` rate — proxy signal from the overflow path.
- Config: `GLOBAL_RATE_LIMIT_ENABLED`, `GLOBAL_RATE_LIMIT_TOKEN_DISTINCTID_THRESHOLD`
4. **Overflow routing** (the combined effect)
@@ -154,7 +153,7 @@ Then check infrastructure health:
## 7. "Comparing prod-us vs prod-eu" — cross-environment
-Most capture app metrics use the `role` label but **no environment label** —
+Most capture app metrics use `namespace`/`container` labels but **no environment label** —
the environment is implicit in which Grafana instance you're connected to.
For cross-environment comparison:
@@ -165,5 +164,8 @@ For cross-environment comparison:
in the query.
3. **Dashboard variables** — some dashboards have an `environment` variable.
Check with `get_dashboard_by_uid` and look at template variables.
-4. **Kafka topic names** are the same across environments — the topic label works
- for comparing produce patterns.
+4. **Kafka topic names differ by partition count** — `ingestion-analytics-main-1024` (US)
+ vs `ingestion-analytics-main-512` (EU). The `topic` label works for comparing produce
+ patterns but values won't match across envs.
+5. **Both envs have a dedicated ingestion MSK cluster** — capture-analytics and capture-ai
+ produce to `msk-ingestion`, not the events cluster (prod-us: c21; prod-eu: `posthog-prod-eu-ingestion-*`).
diff --git a/.agents/skills/monitoring-ingestion-pipeline/SKILL.md b/.agents/skills/monitoring-ingestion-pipeline/SKILL.md
index 8a024443bb28..9023459f36c0 100644
--- a/.agents/skills/monitoring-ingestion-pipeline/SKILL.md
+++ b/.agents/skills/monitoring-ingestion-pipeline/SKILL.md
@@ -15,14 +15,14 @@ It consumes events from Kafka (produced by the capture service), runs them throu
processing steps (person resolution, group assignment, property overrides, etc.),
and produces enriched events to ClickHouse-bound Kafka topics.
-A single codebase is deployed as **many K8s Deployments** via the `posthog-node`
-Helm chart. Each deployment sets `PLUGIN_SERVER_MODE` and is distinguished in
-metrics by two default Prometheus labels:
+A single codebase is deployed as **many K8s Deployments** via the `posthog-app`
+Helm chart (golden-chart migration). Each deployment sets `PLUGIN_SERVER_MODE`
+and is distinguished in metrics by two default Prometheus labels:
-- `ingestion_pipeline` — values: `general`, `heatmaps`, `client_warnings`, `errortracking`
-- `ingestion_lane` — values: `main`, `overflow`, `historical`, `async`
+- `ingestion_pipeline` — values: `analytics`, `heatmaps`, `clientwarnings`, `errortracking`
+- `ingestion_lane` — values: `main`, `overflow`, `historical`, `async`, `turbo`
-The `app` label (set by K8s) matches the deployment name and is the most
+The `app` label (set by K8s pod labels) matches the deployment name and is the most
universal scope filter across all telemetry domains.
This skill teaches how to **discover live metrics** using the Grafana MCP tools
@@ -47,7 +47,10 @@ and ClickHouse `type` label values are **identical** across prod-us and prod-eu.
Key differences:
-- `ingestion-general-turbo` deployment exists only in **prod-us**.
+- `ingestion-analytics-turbo` deployment exists only in **prod-us**.
+- Both envs use a **dedicated ingestion MSK** cluster separate from the events cluster —
+ consumers point at `msk-ingestion` not `events`
+ (prod-us: c21; prod-eu: `posthog-prod-eu-ingestion-2026-05-04`).
- CloudWatch cluster IDs differ by region suffix (see topology sections below).
## Observability landscape
@@ -74,54 +77,64 @@ These facts change infrequently and are hard to discover dynamically.
### Deployment roles
-All `PLUGIN_SERVER_MODE=ingestion-v2` deployments (the "analytics ingestion" family), plus specialized modes:
-
-| Deployment name | Mode | Lane | Consumer group | Consume topic pattern |
-| ------------------------------ | ------------------------------ | ------------ | ----------------------------- | ------------------------------------------- |
-| `ingestion-events` | `ingestion-v2` | `main` | `ingestion-events` | `ingestion-events-{partitions}` |
-| `ingestion-events-overflow` | `ingestion-v2` | `overflow` | `ingestion-events-overflow` | `ingestion-events-overflow-{partitions}` |
-| `ingestion-events-historical` | `ingestion-v2` | `historical` | `ingestion-events-historical` | `ingestion-events-historical-{partitions}` |
-| `ingestion-events-async` | `ingestion-v2` | `async` | `ingestion-events-async` | `events_plugin_ingestion_async` |
-| `ingestion-client-warnings` | `ingestion-v2` | — | `ingestion-client-warnings` | `client_iwarnings_ingestion` |
-| `ingestion-heatmaps` | `ingestion-v2` | — | `ingestion-heatmaps` | `heatmaps_ingestion` |
-| `ingestion-general-turbo` | `ingestion-v2` | — | `ingestion-general-turbo` | `ingestion-general-turbo-{partitions}` |
-| `ingestion-batch-imports` | `ingestion-v2` | — | `ingestion-batch-imports` | `ingestion-batch-imports` |
-| `ingestion-logs` | `ingestion-logs` | — | `ingestion-logs` | `logs_ingestion` |
-| `ingestion-errortracking-main` | `ingestion-errortracking` | — | `ingestion-errortracking` | `ingestion-errortracking-main-{partitions}` |
-| `recordings-blob-ingestion-v2` | `recordings-blob-ingestion-v2` | — | `session-recordings-blob-v2` | `session_recording_snapshot_item_events` |
-
-**Note:** `ingestion-general-turbo` exists only in **prod-us**.
+All `PLUGIN_SERVER_MODE=ingestion-v2` deployments (the "analytics ingestion" family), plus specialized modes.
+Each golden-chart deployment runs in its **own namespace** matching the deployment name.
+
+| Deployment name | Mode | Pipeline | Lane | Consumer group | Consume topic (EU example) |
+| --------------------------------------- | ------------------------------ | ---------------- | ------------ | ------------------------------------- | ------------------------------------- |
+| `ingestion-analytics-main` | `ingestion-v2` | `analytics` | `main` | `ingestion-analytics-main` | `ingestion-analytics-main-512` |
+| `ingestion-analytics-overflow` | `ingestion-v2` | `analytics` | `overflow` | `ingestion-analytics-overflow` | `ingestion-analytics-overflow-128` |
+| `ingestion-analytics-historical` | `ingestion-v2` | `analytics` | `historical` | `ingestion-analytics-historical` | `ingestion-analytics-historical-128` |
+| `ingestion-analytics-async` | `ingestion-v2` | `analytics` | `async` | `ingestion-analytics-async` | `ingestion-analytics-async-8` |
+| `ingestion-analytics-turbo` | `ingestion-v2` | `analytics` | `turbo` | `ingestion-analytics-turbo` | `ingestion-analytics-turbo-1024` |
+| `ingestion-clientwarnings-main` | `ingestion-v2` | `clientwarnings` | — | `ingestion-clientwarnings-main` | `ingestion-clientwarnings-main-32` |
+| `ingestion-heatmaps-main` | `ingestion-v2` | `heatmaps` | — | `ingestion-heatmaps-main` | `ingestion-heatmaps-main-128` |
+| `ingestion-errortracking-main` | `ingestion-errortracking` | `errortracking` | — | `ingestion-errortracking-main` | `ingestion-errortracking-main-128` |
+| `ingestion-errortracking-overflow` | `ingestion-errortracking` | `errortracking` | — | `ingestion-errortracking-overflow` | `ingestion-errortracking-overflow-32` |
+| `logs-ingestion` | `ingestion-logs` | — | — | `logs-ingestion` | `ingestion-logs` |
+| `traces-ingestion` | (traces) | — | — | `traces-ingestion` | `ingestion-traces` |
+| `recordings-blob-ingestion-v2` | `recordings-blob-ingestion-v2` | — | — | `session-recordings-blob-v2` | `ingestion-sessionreplay-main-256` |
+| `recordings-blob-ingestion-v2-overflow` | `recordings-blob-ingestion-v2` | — | — | `session-recordings-blob-v2-overflow` | `ingestion-sessionreplay-overflow-32` |
+
+**Notes:**
+
+- `ingestion-analytics-turbo` exists only in **prod-us**.
+- Topic partition counts differ by env (e.g., main is 1024 in US, 512 in EU).
+- Each deployment also has a DLQ topic (`ingestion-analytics-main-dlq`, etc.).
+- KEDA autoscaling queries reference **both old and new** consumer group names during migration
+ (e.g., `groupId=~"ingestion-events|ingestion-analytics-main"`).
### Metric prefixes
Every prefix here can be discovered live with `list_prometheus_metric_names`
using `datasourceUid: "victoriametrics"` and `regex: "<prefix>.*"`.
-| Prefix | Domain | Key scope labels |
-| -------------------------------------------------------------------------------- | ------------------------------------------ | -------------------------------------------------- |
-| `ingestion_*` | Core ingestion app metrics (~80 metrics) | `app`, `ingestion_pipeline`, `ingestion_lane` |
-| `consumed_batch_*` | Kafka consumer batch processing | `topic`, `groupId` |
-| `consumer_batch_*` / `consumer_background_*` | Consumer loop health | `topic`, `groupId` |
-| `kafka_broker_*` | librdkafka broker stats | `broker_id`, `broker_name`, `consumer_group` |
-| `kafka_consumer_*` | Consumer rebalance, assignment | `groupId`, `type` |
-| `events_pipeline_*` | Legacy pipeline step metrics | `step_name` |
-| `person_*` | Person processing (~30 metrics) | `db_write_mode`, `operation`, `method` |
-| `group_*` (non-AWS) | Group processing | `operation` |
-| `personhog_*` | PersonHog gRPC client + service | `method`, `source`, `client` |
-| `overflow_redirect_*` | Stateful overflow routing | `type`, `result`, `decision`, `operation` |
-| `cookieless_*` | Cookieless mode | — |
-| `http_request_duration_seconds` | HTTP health/readiness server | `method`, `route`, `status_code` |
-| `recording_blob_ingestion_v2_*` | Session replay ingestion | `app` |
-| `logs_ingestion_*` | Logs ingestion pipeline | `app` |
-| `error_tracking_*` / `cymbal_*` | Error tracking pipeline | `app` |
-| `kminion_kafka_*` | KMinion consumer group lag & topic offsets | `group_id`, `topic_name`, `partition_id` |
-| `aws_msk_kafka_*` | MSK broker-side JMX metrics | `environment` |
-| `warpstream_agent_*` | WarpStream agent metrics | varies |
-| `kube_*` / `container_*` | K8s resources | `namespace="posthog"`, `container=~"ingestion-.*"` |
-| `pg_*` / `pgbouncer_*` | Postgres exporter | varies |
-| `ClickHouseMetrics_*` / `ClickHouseProfileEvents_*` / `ClickHouseAsyncMetrics_*` | ClickHouse cluster health | `type` (=cluster role) |
-| `kafka_connect_*` | Kafka Connect bridge to ClickHouse | `namespace`, `connector` |
-| `posthog_celery_clickhouse_*` | CH health monitors from Django celery | `scenario` |
+| Prefix | Domain | Key scope labels |
+| -------------------------------------------------------------------------------- | ------------------------------------------ | -------------------------------------------------------- |
+| `ingestion_*` | Core ingestion app metrics (~80 metrics) | `app`, `ingestion_pipeline`, `ingestion_lane` |
+| `ingestion_lag_ms*` | Per-partition lag (primary lag signal) | `groupId`, `partition` |
+| `consumed_batch_*` | Kafka consumer batch processing | `topic`, `groupId` |
+| `consumer_batch_*` / `consumer_background_*` | Consumer loop health | `topic`, `groupId` |
+| `kafka_broker_*` | librdkafka broker stats | `broker_id`, `broker_name`, `consumer_group` |
+| `kafka_consumer_*` | Consumer rebalance, assignment | `groupId`, `type` |
+| `events_pipeline_*` | Legacy pipeline step metrics | `step_name` |
+| `person_*` | Person processing (~30 metrics) | `db_write_mode`, `operation`, `method` |
+| `group_*` (non-AWS) | Group processing | `operation` |
+| `personhog_*` | PersonHog gRPC client + service | `method`, `source`, `client` |
+| `overflow_redirect_*` | Stateful overflow routing | `type`, `result`, `decision`, `operation` |
+| `cookieless_*` | Cookieless mode | — |
+| `http_request_duration_seconds` | HTTP health/readiness server | `method`, `route`, `status_code` |
+| `recording_blob_ingestion_v2_*` | Session replay ingestion | `app` |
+| `logs_ingestion_*` | Logs ingestion pipeline | `app` |
+| `error_tracking_*` / `cymbal_*` | Error tracking pipeline | `app` |
+| `kminion_kafka_*` | KMinion consumer group lag & topic offsets | `group_id`, `topic_name`, `partition_id` |
+| `aws_msk_kafka_*` | MSK broker-side JMX metrics | `environment` |
+| `warpstream_agent_*` | WarpStream agent metrics (~10 metrics) | `virtual_cluster_id`, `agent_group`, `operation` |
+| `kube_*` / `container_*` | K8s resources | `namespace=~"ingestion-.*"`, `container=~"ingestion-.*"` |
+| `pg_*` / `pgbouncer_*` | Postgres exporter | varies |
+| `ClickHouseMetrics_*` / `ClickHouseProfileEvents_*` / `ClickHouseAsyncMetrics_*` | ClickHouse cluster health | `type` (=cluster role) |
+| `kafka_connect_*` | Kafka Connect bridge to ClickHouse | `namespace`, `connector` |
+| `posthog_celery_clickhouse_*` | CH health monitors from Django celery | `scenario` |
### Redis topology
@@ -139,18 +152,56 @@ Redis health is inferred from ingestion-side metrics and CloudWatch ElastiCache
Ingestion-side Redis metrics: `overflow_redirect_redis_*`, `cookieless_redis_error`.
Infrastructure-side: CloudWatch datasource `P034F075C744B399F`.
-prod-eu uses the same logical cluster names but different endpoint suffixes
-(`.mkct36...euc1` instead of `.nfjpjm...use1`).
+prod-eu uses the same logical cluster names but different endpoint suffixes.
The prod-eu primary Redis is `posthog-prod-redis-encripted` (sic — the typo is in the actual cluster name).
+The event restrictions Redis (`ingestion-prod-redis`) is a **separate writable cluster** from
+the primary — capture-analytics and ingestion workers both use it via `EVENT_RESTRICTIONS_REDIS_URL`.
### Kafka topology
-Two backing systems:
-
-- **MSK** — prod-us: `posthog-prod-us-events-2026-03-08` (12 brokers, `kafka.m7g.8xlarge`, tiered storage); prod-eu: `posthog-prod-eu-events-2025-10-16` (15 brokers, `kafka.m7g.4xlarge`)
-- **WarpStream** — in-cluster agents in `warpstream-ingestion` namespace; virtual cluster `vcn_ingestion_prod_us` / `vcn_ingestion_prod_eu`
-
-KMinion instance for MSK: `app_kubernetes_io_instance=~"kminion-msk-analytics"`.
+Ingestion workers interact with **three Kafka systems** via separate producer/consumer configs:
+
+1. **MSK ingestion cluster** (consume side) — `KAFKA_CONSUMER_METADATA_BROKER_LIST`.
+ Capture produces here; ingestion workers consume. Carries all `ingestion-analytics-*`,
+ `ingestion-errortracking-*`, `ingestion-heatmaps-*`, `ingestion-clientwarnings-*` topics.
+ Both envs have a dedicated cluster (prod-us: c21, 12 brokers; prod-eu: `posthog-prod-eu-ingestion-2026-05-04`).
+ KMinion: `kminion-msk-ingestion`.
+
+2. **WarpStream ingestion VC** (output side) — `KAFKA_WARPSTREAM_PRODUCER_METADATA_BROKER_LIST`.
+ Ingestion workers produce ALL ClickHouse-bound output here (`clickhouse_events_json`,
+ `clickhouse_person`, `clickhouse_groups`, `clickhouse_heatmap_events`, `clickhouse_ai_events_json`, etc.).
+ In-cluster WarpStream agents (`warpstream-ingestion-v2`) with multi-AZ pools; plaintext, no TLS.
+ KMinion: `kminion-warpstream-ingestion`.
+
+3. **MSK ingestion cluster (feedback/DLQ producer)** — same physical cluster as item 1,
+ different producer config via `KAFKA_INGESTION_PRODUCER_METADATA_BROKER_LIST`.
+ Used for overflow/DLQ/async topics that route events BACK to the ingestion system.
+
+- **MSK (events/analytics)** — the original events cluster. Still carries some legacy topics and
+ ClickHouse consumer groups during migration. prod-us: `posthog-prod-us-events-2026-03-08`
+ (12 brokers, `kafka.m7g.8xlarge`); prod-eu: `posthog-prod-eu-events-2025-10-16` (15 brokers).
+ KMinion: `kminion-msk-analytics`.
+
+**WarpStream virtual clusters** — each VC is a separate logical cluster backed by S3, with its own
+agent pool, KMinion instance, and topic namespace:
+
+| VC name | Topics carried | KMinion instance |
+| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- |
+| `warpstream-ingestion-v2` | `clickhouse_events_json`, `clickhouse_person`, `clickhouse_person_distinct_id`, `clickhouse_groups`, `clickhouse_ai_events_json`, `clickhouse_heatmap_events`, `clickhouse_app_metrics2`, `clickhouse_tophog`, `clickhouse_ingestion_warnings`, `distinct_id_usage_events_json`, `log_entries`, `team_event_partitioned_events_json` | `kminion-warpstream-ingestion` |
+| `warpstream-replay-v2` | `ingestion-sessionreplay-main-*`, `clickhouse_session_replay_events`, `clickhouse_session_replay_features` | `kminion-warpstream-replay` |
+| `warpstream-logs` | `ingestion-logs`, `clickhouse_logs` | `kminion-warpstream-logs` |
+| `warpstream-traces` | `ingestion-traces`, `clickhouse_traces` | `kminion-warpstream-traces` |
+| `warpstream-shared` | `clickhouse_document_embeddings`, error tracking fingerprint/issue topics, `document_embeddings_input` | `kminion-warpstream-shared` |
+| `warpstream-calculated-events` | `clickhouse_precalculated_person_properties`, `clickhouse_prefiltered_events`, `cohort_membership_changed` (US only) | `kminion-warpstream-calculated-events` |
+| `warpstream-cyclotron` | CDP topics (`cdp_cyclotron_hog*`, `cdp_internal_events`, etc.) | `kminion-warpstream-cyclotron` |
+| `warpstream-warehouse-pipelines` | `data_warehouse_source_webhooks`, `data_warehouse_sources_jobs` (US only) | `kminion-warpstream-warehouse-pipelines` |
+
+WarpStream agent metrics: `warpstream_agent_*` prefix (~10 metrics).
+Key: `control_plane_operation_counter` (by `operation`), `file_cache_client_fetch_local_or_remote_counter` (cache hit/miss).
+Labels: `virtual_cluster_id`, `agent_group` (`default`, `general`, `multi-az`).
+Dashboards: `warpstream` (Agent Overview), `dbfj5c31spa1ogf` (MSK vs WarpStream — Active Produce Topics).
+US-only personal dashboards (not synced to EU): `8e93b023-…` (CH Consumer Lag),
+`ws-coarse-lag-explore` (Coarse Lag exploration).
### Postgres topology
@@ -195,16 +246,21 @@ like `batch-exports` or `test` may exist only in one env.
**Two consumption paths from Kafka to ClickHouse:**
+ClickHouse now reads primarily from the **WarpStream ingestion VC** (where ingestion workers
+produce their output), not directly from MSK.
+
1. **ClickHouse Kafka Engine** — native CH feature. Metrics prefixed `ClickHouseProfileEvents_Kafka*`
(e.g., `KafkaMessagesPolled`, `KafkaRowsRead`, `KafkaRowsRejected`, `KafkaCommitFailures`).
Consumer groups: `clickhouse_events_json` (prod-us), `group1` / `group1_recent` (prod-eu).
+ These groups exist on BOTH MSK analytics and WarpStream ingestion — use the correct KMinion
+ instance to distinguish: `kminion-warpstream-ingestion` for WarpStream, `kminion-msk-analytics` for MSK.
2. **Kafka Connect** — runs in `kafka-connect` namespace, uses DuckLake sink connector.
Metrics prefixed `kafka_connect_*` and `kafka_connect_ducklake_sink_task_metrics_*`.
Consumer groups: `connect-events-ducklake*`.
**Key health signals for ingestion operators:**
-- `kminion_kafka_consumer_group_topic_lag{group_id=~"clickhouse_events_json|group1|group1_recent", topic_name="clickhouse_events_json"}` — lag between ingestion output and CH consumption (group name differs by env: `clickhouse_events_json` in prod-us, `group1`/`group1_recent` in prod-eu)
+- `kminion_kafka_consumer_group_topic_lag{app_kubernetes_io_instance="kminion-warpstream-ingestion", group_id=~"clickhouse_events_json|group1|group1_recent", topic_name="clickhouse_events_json"}` — lag between ingestion output and CH consumption on the WarpStream path (the primary path)
- `kminion_kafka_consumer_group_topic_lag_seconds` with same group filter — same in seconds
- `ClickHouseProfileEvents_KafkaRowsRejected` — rows CH couldn't parse/insert
- `ClickHouseProfileEvents_FailedInsertQuery` — insert failures (schema issues, too many parts, etc.)
@@ -215,19 +271,24 @@ like `batch-exports` or `test` may exist only in one env.
### Pyroscope services
-| Service name | Deployment |
-| ----------------------------------------------------------- | ---------------------------- |
-| `ingestion/ingestion-events` | Main analytics |
-| `ingestion/ingestion-events-overflow` | Overflow lane |
-| `ingestion/ingestion-events-historical` | Historical lane |
-| `ingestion/ingestion-events-async` | Async lane |
-| `ingestion/ingestion-heatmaps` | Heatmaps |
-| `ingestion/ingestion-client-warnings` | Client warnings |
-| `ingestion/ingestion-general-turbo` | General turbo (prod-us only) |
-| `ingestion/ingestion-logs` | Logs ingestion |
-| `ingestion/ingestion-batch-imports` | Batch imports |
-| `ingestion-errortracking-main/ingestion-errortracking-main` | Error tracking |
-| `recordings/recordings-blob-ingestion-v2` | Session replay |
+Both old (`ingestion/{name}`) and new (`{namespace}/{name}`) formats coexist in Pyroscope
+during the golden-chart migration. Prefer the new `{namespace}/{name}` format.
+
+| Service name (new format) | Deployment |
+| ------------------------------------------------------------------- | ------------------------- |
+| `ingestion-analytics-main/ingestion-analytics-main` | Main analytics |
+| `ingestion-analytics-overflow/ingestion-analytics-overflow` | Overflow lane |
+| `ingestion-analytics-historical/ingestion-analytics-historical` | Historical lane |
+| `ingestion-analytics-async/ingestion-analytics-async` | Async lane |
+| `ingestion-analytics-turbo/ingestion-analytics-turbo` | Turbo lane (prod-us only) |
+| `ingestion-heatmaps-main/ingestion-heatmaps-main` | Heatmaps |
+| `ingestion-clientwarnings-main/ingestion-clientwarnings-main` | Client warnings |
+| `ingestion-errortracking-main/ingestion-errortracking-main` | Error tracking |
+| `ingestion-errortracking-overflow/ingestion-errortracking-overflow` | Error tracking overflow |
+| `logs-ingestion/logs-ingestion` | Logs ingestion |
+| `traces-ingestion/traces-ingestion` | Traces ingestion |
+| `recordings/recordings-blob-ingestion-v2` | Session replay |
+| `recordings/recordings-blob-ingestion-v2-overflow` | Session replay overflow |
Profile types: `process_cpu:cpu:nanoseconds:cpu:nanoseconds`,
`wall:wall:nanoseconds:wall:nanoseconds`,
@@ -236,32 +297,36 @@ Profile types: `process_cpu:cpu:nanoseconds:cpu:nanoseconds`,
### Grafana dashboards
-| UID | Title | Focus |
-| -------------------------------------- | ------------------------------------------- | --------------------------------------------- |
-| `ingestion-general` | Ingestion - General | Cross-service overview, E2E lag, topic flow |
-| `ingestion-pipelines` | Ingestion - Pipelines | Per-lane pipeline step breakdown |
-| `ingestion-pipeline-performance` | Ingestion - Pipeline Performance | Step latency, batch utilization |
-| `ingestion-reliability` | Ingestion - Reliability | Error rates, DLQ, drop causes |
-| `ingestion-autoscaling` | Ingestion - Autoscaling | HPA/KEDA scaling |
-| `ingestion-person-processing` | Ingestion -- Person Processing | Person store, merge, cache |
-| `ingestion-group-processing` | Ingestion -- Group Processing | Group store |
-| `ingestion-session-recordings` | Session Replay -- Ingestion | Replay blob pipeline |
-| `ingestion-capture` | Ingestion - Capture | Capture-specific ingestion metrics |
-| `ceef2kuqw66tca` | Ingestion copy for warpstream | WarpStream-specific |
-| `personhog-service` | Personhog service | PersonHog latency decomposition |
-| `personhog-cdp-migration` | PersonHog CDP/NodeJS migration | PersonHog rollout |
-| `dbfgkwxs3gw8owd` | KMinion Consumer Group Lag | Consumer lag by group (including CH groups) |
-| `logs` | Logs (product) | Logs ingestion |
-| `vm-clickhouse-cluster-overview` | ClickHouse (cluster overview) | QPS, memory, disk, replication, parts, merges |
-| `8aa35a4a-091a-4645-ac8f-ae46901f0060` | ClickHouse Ingestion Layer - Resource Usage | K8s resources for `chi-ingestion-*` pods |
-| `dafd3tvakk4t1cd` | ClickHouse - Data Inserted Per Table | Insert rates per table |
-| `edvegyvt4u8sge` | ClickHouse - Query Metrics | Query performance |
-| `clickhouse-keeper` | ClickHouse Keeper | ZooKeeper replacement health |
-| `ef2loyheonm68a` | ClickHouse - table sizes and growth | Storage growth |
-| `ef7h2todfg4xsd` | New ClickHouse Cluster Merge Overview | Merge throughput |
-| `cdzv7o1635n9ca` | Kafka Connect | Kafka Connect tasks, lag, DuckLake sink |
-| `ddpxkllwxg268e` | (ingestion vs past) | CH ingestion rate vs historical comparison |
-| `deoz13wy08wsga` | ClickHouse - Disk capacity (EU ONLY) | EU-specific disk dashboard |
+| UID | Title | Focus |
+| -------------------------------------- | ------------------------------------------- | --------------------------------------------------- |
+| `ingestion-general` | Ingestion - General | Cross-service overview, E2E lag, topic flow |
+| `ingestion-analytics` | Ingestion - Analytics | Per-pipeline analytics breakdown |
+| `ingestion-health` | Ingestion - Health | Health overview across all ingestion services |
+| `ingestion-pipelines` | Ingestion - Pipelines | Per-lane pipeline step breakdown |
+| `ingestion-pipeline-performance` | Ingestion - Pipeline Performance | Step latency, batch utilization |
+| `ingestion-reliability` | Ingestion - Reliability | Error rates, DLQ, drop causes |
+| `ingestion-autoscaling` | Ingestion - Autoscaling | HPA/KEDA scaling |
+| `ingestion-person-processing` | Ingestion -- Person Processing | Person store, merge, cache |
+| `ingestion-group-processing` | Ingestion -- Group Processing | Group store |
+| `ingestion-session-recordings` | Session Replay -- Ingestion | Replay blob pipeline |
+| `dffkdlee8ub5s0a` | Ingestion - Capture Golden | Capture-specific ingestion metrics (golden chart) |
+| `cesaxfujkyl8gf` | Ingestion - Deduplication | Event deduplication pipeline |
+| `pl-ingestion-slas` | Ingestion — SLIs / SLOs / SLAs | Dynamic SLI/SLO view from `ingestion_sli_*` metrics |
+| `warpstream` | Warpstream Agent Overview | Agent health, control plane ops, file cache |
+| `dbfj5c31spa1ogf` | MSK vs Warpstream — Active Produce Topics | Side-by-side produce volume comparison |
+| `8e93b023-a544-4a3b-8fac-123459d4eb84` | WarpStream: ClickHouse Consumer Lag | CH consumer lag on WarpStream topics (US only) |
+| `ws-coarse-lag-explore` | WarpStream Coarse Lag — Explore | Agent-reported lag (US only, personal dashboard) |
+| `ceef2kuqw66tca` | Ingestion copy for warpstream | Legacy WarpStream migration view |
+| `personhog-service` | Personhog service | PersonHog latency decomposition |
+| `dbfgkwxs3gw8owd` | KMinion Consumer Group Lag | Consumer lag by group (including CH groups) |
+| `logs` | Logs (product) | Logs ingestion |
+| `vm-clickhouse-cluster-overview` | ClickHouse (cluster overview) | QPS, memory, disk, replication, parts, merges |
+| `8aa35a4a-091a-4645-ac8f-ae46901f0060` | ClickHouse Ingestion Layer - Resource Usage | K8s resources for `chi-ingestion-*` pods |
+| `ddpxkllwxg268e` | ClickHouse - Kafka consumption | CH Kafka engine consumption stats |
+| `clickhouse-keeper` | ClickHouse Keeper | ZooKeeper replacement health |
+| `ef7h2todfg4xsd` | New ClickHouse Cluster Merge Overview | Merge throughput |
+| `cdzv7o1635n9ca` | Kafka Connect | Kafka Connect tasks, lag, DuckLake sink |
+| `deoz13wy08wsga` | ClickHouse - Disk capacity (EU ONLY) | EU-specific disk dashboard |
## Discovery workflows
@@ -279,13 +344,13 @@ Repeat with other prefixes: `consumed_batch_*`, `person_*`, `personhog_*`,
### Loki (logs)
1. `list_loki_label_names` — `datasourceUid: "P44D702D3E93867EC"`
-2. `list_loki_label_values` for `app` — find ingestion containers (values like `ingestion-events`, `ingestion-logs`, etc.)
+2. `list_loki_label_values` for `app` — find ingestion containers (values like `ingestion-analytics-main`, `logs-ingestion`, etc.)
3. `query_loki_logs` — e.g. `{app=~"ingestion-.*"} |= "error"` or `{namespace="clickhouse"} |= "Exception"`
### Pyroscope (profiling)
1. `list_pyroscope_profile_types` — `data_source_uid: "pyroscope"`
-2. `fetch_pyroscope_profile` — `matchers: '{service_name="ingestion/ingestion-events"}'`,
+2. `fetch_pyroscope_profile` — `matchers: '{service_name="ingestion-analytics-main/ingestion-analytics-main"}'`,
`profile_type: "process_cpu:cpu:nanoseconds:cpu:nanoseconds"`
### Dashboards
@@ -316,10 +381,12 @@ Repeat with other prefixes: `consumed_batch_*`, `person_*`, `personhog_*`,
- Kafka engine health: regex `"ClickHouseProfileEvents_Kafka.*"`
- Kafka Connect: regex `"kafka_connect_.*"` — scope with `namespace="kafka-connect"`
- Consumer lag (the bridge): `kminion_kafka_consumer_group_topic_lag` with
- `group_id=~"clickhouse_events_json|group1|group1_recent|connect-events-ducklake.*"` and `topic_name="clickhouse_events_json"`
+ `group_id=~"clickhouse_events_json|group1|group1_recent|connect-events-ducklake.*"` and `topic_name="clickhouse_events_json"`.
+ **Important:** scope with `app_kubernetes_io_instance="kminion-warpstream-ingestion"` for the
+ WarpStream path (primary) or `"kminion-msk-analytics"` for the MSK path.
- Logs: `{namespace="clickhouse"} |= "Exception"` or `{namespace="kafka-connect"}`
- Dashboards: `vm-clickhouse-cluster-overview`, `8aa35a4a-091a-4645-ac8f-ae46901f0060`,
- `cdzv7o1635n9ca`
+ `cdzv7o1635n9ca`, `8e93b023-a544-4a3b-8fac-123459d4eb84` (WarpStream CH consumer lag)
## Key metric domains
@@ -349,7 +416,7 @@ to the query layer. Metrics: `ClickHouseMetrics_*`, `ClickHouseProfileEvents_*`,
`ClickHouseAsyncMetrics_*` scoped by `type`; `kafka_connect_*` scoped by `namespace`.
**K8s resources** — `container_*` and `kube_*` for CPU, memory, restarts, HPA state.
-Scope: `namespace="posthog"`, `pod=~"ingestion-.*"` (or `namespace="clickhouse"`,
+Scope: `namespace=~"ingestion-.*"`, `pod=~"ingestion-.*"` (or `namespace="clickhouse"`,
`pod=~"chi-ingestion-.*"` for CH ingestion pods).
## Investigation playbooks
diff --git a/.agents/skills/monitoring-ingestion-pipeline/references/investigation-playbooks.md b/.agents/skills/monitoring-ingestion-pipeline/references/investigation-playbooks.md
index 634c2f6db6cc..1e9afa281f90 100644
--- a/.agents/skills/monitoring-ingestion-pipeline/references/investigation-playbooks.md
+++ b/.agents/skills/monitoring-ingestion-pipeline/references/investigation-playbooks.md
@@ -11,16 +11,19 @@ Start by pulling up the main dashboard:
Then verify these signals in order:
-1. **E2E event lag** — `posthog_celery_observed_ingestion_lag_seconds{scenario="ingestion_api"}`.
- This is the Django-measured end-to-end lag from event capture to ClickHouse visibility.
- Sustained values > 60s warrant investigation.
+1. **E2E event lag** — two complementary metrics:
+ - `ingestion_lag_ms{groupId=~"ingestion-analytics-main"}` — per-partition lag measured
+ by the consumer itself; the primary signal driving KEDA autoscaling.
+ - `posthog_celery_observed_ingestion_lag_seconds{scenario="ingestion_api"}` —
+ Django-measured end-to-end lag from event capture to ClickHouse visibility.
+ Sustained values > 60s on either warrant investigation.
2. **Consumer group lag** — `kminion_kafka_consumer_group_topic_lag_seconds` scoped to
- key groups: `ingestion-events`, `ingestion-events-overflow`, `session-recordings-blob-v2`.
+ key groups: `ingestion-analytics-main`, `ingestion-analytics-overflow`, `session-recordings-blob-v2`.
Growing lag = consumers falling behind.
3. **Pipeline results** — `ingestion_pipeline_results` by `result`.
Watch for rising `dlq` or `dropped` rates relative to `ingested`.
4. **Pod restarts** — `kube_pod_container_status_restarts_total` for
- `namespace="posthog"`, `pod=~"ingestion-.*"`. Any recent restarts?
+ `namespace=~"ingestion-.*"`, `pod=~"ingestion-.*"`. Any recent restarts?
5. **ClickHouse consumer lag** — `kminion_kafka_consumer_group_topic_lag{group_id=~"clickhouse_events_json|group1|group1_recent", topic_name="clickhouse_events_json"}`.
This is the final leg: even if ingestion workers are healthy, CH lag means users see stale data.
(Consumer group name differs by env: `clickhouse_events_json` in prod-us, `group1`/`group1_recent` in prod-eu.)
@@ -82,7 +85,7 @@ Diagnose layer by layer, from consumer to output:
Partitions should be evenly distributed. Zero = consumer not assigned.
5. **Rebalance events** — `consumer_background_task_timeout_total` for timeouts
that trigger rebalances. Check Loki logs for rebalance messages:
- `{app=~"ingestion-events.*"} |= "rebalance"`.
+ `{app=~"ingestion-analytics.*"} |= "rebalance"`.
6. **Backpressure from downstream** — if Kafka production to output topics is slow
(`ingestion_outputs_latency_seconds` high), the consumer can't commit offsets fast enough.
@@ -108,15 +111,25 @@ Diagnose layer by layer, from consumer to output:
1. **Broker RTT** — `kafka_broker_rtt_us` by `broker_name` and `consumer_group`.
Identify if a single broker is slow vs all brokers.
2. **Broker connectivity** — check for librdkafka error logs in Loki:
- `{app=~"ingestion-events.*"} |= "broker"`.
+ `{app=~"ingestion-analytics.*"} |= "broker"`.
3. **MSK JMX metrics** — `list_prometheus_metric_names` regex `"aws_msk_kafka.*"`.
Key signals: throttle time, network processor idle %, request queue size.
-4. **WarpStream** — `warpstream_agent_*` metrics for WarpStream-backed topics.
- Scope to `warpstream-ingestion` namespace.
+4. **WarpStream agent health** — `warpstream_agent_*` metrics. Ingestion workers
+ produce ALL ClickHouse-bound output to WarpStream (`warpstream-ingestion-v2` VC).
+ Key signals:
+ - `warpstream_agent_control_plane_operation_counter` by `operation` — control plane errors
+ - `warpstream_agent_file_cache_client_fetch_local_or_remote_counter` — cache hit/miss
+ - Agent groups: `general` (consumer-side, single-AZ) and `multi-az` (producer-side)
+ Dashboards: `warpstream` (Agent Overview), `dbfj5c31spa1ogf` (MSK vs WarpStream topics).
+ Per-VC KMinion: `kminion-warpstream-ingestion`, `kminion-warpstream-replay`,
+ `kminion-warpstream-logs`, `kminion-warpstream-traces`, etc.
5. **KMinion cluster view** — dashboard `dbfgkwxs3gw8owd` for lag across all
- consumer groups and topics.
+ consumer groups and topics. Note: there are separate KMinion instances per
+ WarpStream VC (`kminion-warpstream-*`) and per MSK cluster (`kminion-msk-*`).
+ Scope lag queries with `app_kubernetes_io_instance` to target the correct backing system.
6. **Topic production** — `ingestion_outputs_message_value_bytes` by `topic` for
- output volume. Compare with consumption rate to find bottlenecks.
+ output volume. These go to WarpStream, not MSK. Compare with CH consumption
+ rate to find bottlenecks.
## 7. "Redis problems" — diagnosing Redis dependency failures
@@ -137,7 +150,7 @@ Then check infrastructure health:
Cluster IDs: `ingestion-prod-redis`, `posthog-solo` (prod-us primary),
`cookieless-prod-redis`, `ingestion-duplicates-prod-redis`.
prod-eu primary: `posthog-prod-redis-encripted` (sic).
-2. **Loki logs** — `{app=~"ingestion-events.*"} |= "redis" |= "error"`.
+2. **Loki logs** — `{app=~"ingestion-analytics.*"} |= "redis" |= "error"`.
3. **Fail-open behavior** — ingestion workers are generally designed to fail open
for Redis failures, but overflow routing accuracy degrades.
@@ -153,8 +166,8 @@ Then check infrastructure health:
Key metrics: `CPUUtilization`, `ReadLatency`, `WriteLatency`, `DatabaseConnections`.
4. **Postgres exporter** — `list_prometheus_metric_names` regex `"pg_.*"`.
`prometheus-postgres-exporter` and `prometheus-postgres-persons-exporter`.
-5. **Loki logs** — `{app=~"ingestion-events.*"} |= "postgres" |= "error"` or
- `{app=~"ingestion-events.*"} |= "ECONNREFUSED"`.
+5. **Loki logs** — `{app=~"ingestion-analytics.*"} |= "postgres" |= "error"` or
+ `{app=~"ingestion-analytics.*"} |= "ECONNREFUSED"`.
## 9. "Session replay ingestion issues" — replay pipeline
@@ -163,6 +176,7 @@ Then check infrastructure health:
3. **Replay metrics** — `list_prometheus_metric_names` regex `"recording_blob_ingestion_v2_.*"`.
Key: batch size, S3 upload latency, session manager operations.
4. **K8s resources** — scope to `app="recordings-blob-ingestion-v2"`.
+ Also check `recordings-blob-ingestion-v2-overflow` for overflow pipeline health.
5. **Pyroscope** — profile `recordings/recordings-blob-ingestion-v2` for CPU/memory hotspots.
## 10. "ClickHouse ingestion is behind" — downstream health
@@ -170,10 +184,13 @@ Then check infrastructure health:
ClickHouse lag means users see stale data even if ingestion workers are healthy.
1. **Consumer lag on `clickhouse_events_json`** —
- `kminion_kafka_consumer_group_topic_lag{group_id=~"clickhouse_events_json|group1|group1_recent", topic_name="clickhouse_events_json"}`.
+ ClickHouse now reads primarily from the **WarpStream ingestion VC**, so scope to the
+ correct KMinion instance:
+ `kminion_kafka_consumer_group_topic_lag{app_kubernetes_io_instance="kminion-warpstream-ingestion", group_id=~"clickhouse_events_json|group1|group1_recent", topic_name="clickhouse_events_json"}`.
Also check `kminion_kafka_consumer_group_topic_lag_seconds` for time-based lag.
(Consumer group name differs by env: `clickhouse_events_json` in prod-us, `group1`/`group1_recent` in prod-eu.)
- Dashboard: `dbfgkwxs3gw8owd` (KMinion Consumer Group Lag).
+ Dashboards: `dbfgkwxs3gw8owd` (KMinion Consumer Group Lag — all backing systems),
+ `8e93b023-a544-4a3b-8fac-123459d4eb84` (WarpStream CH Consumer Lag — US only, personal dashboard).
2. **CH Kafka engine errors** — `ClickHouseProfileEvents_KafkaRowsRejected{type="events"}` rate.
Also `ClickHouseProfileEvents_KafkaConsumerErrors` and `KafkaCommitFailures`.
@@ -227,4 +244,9 @@ For cross-environment comparison:
- Redis: `posthog-solo` (US) vs `posthog-prod-redis-encripted` (EU) for primary
- MSK: `posthog-prod-us-events-*` vs `posthog-prod-eu-events-*`
- RDS: `posthog-cloud-prod-us-east-1` vs `posthog-cloud-prod-eu-central-1`
-5. **Deployment differences** — `ingestion-general-turbo` exists only in **prod-us**.
+5. **Deployment differences** — `ingestion-analytics-turbo` exists only in **prod-us**.
+6. **Kafka topology** — both envs use a **dedicated ingestion MSK** cluster
+ (prod-us: c21; prod-eu: `posthog-prod-eu-ingestion-*`) for the consume side and
+ **WarpStream** (`warpstream-ingestion-v2` VC) for the ClickHouse output side.
+ Topic partition counts differ (e.g., main is 1024 in US, 512 in EU; clientwarnings is 16 in US, 32 in EU).
+ WarpStream VCs exist in both envs with the same logical names but different `virtual_cluster_id` values.