: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
chore(metrics): remove in-repo internal design docs (#73003)
Daniel Visca53b71522b18f
diff --git a/docs/internal/metrics/dashboard-mvp.md b/docs/internal/metrics/dashboard-mvp.mddeleted file mode 100644index 2db6f0197132..000000000000--- a/docs/internal/metrics/dashboard-mvp.md+++ /dev/null@@ -1,175 +0,0 @@-# Metrics Dashboard MVP — Replacing the Grafana logs.json inside PostHog--**Status:** design — owners @daniel-v, #team-apm (@jonmcwest, @frankh).-**Sibling docs:** [`docs/internal/prom-compat/design.md`](../prom-compat/design.md) (read plane for Prometheus ecosystem — out of scope here).--## Why--The cluster's `logs.json` Grafana dashboard (≈60 panels, source: `PostHog/grafana-dashboards/logs.json`) is the on-call surface for the logs / traces / metrics ingestion stack.-We already store metrics natively in `metrics1` on the logs ClickHouse cluster.-This doc scopes the work to render that exact dashboard inside PostHog (`/dashboard/...`) against `posthog.metrics`, so on-call can leave Grafana behind.--Native PostHog Metrics stays the user-facing product. The Prometheus-ecosystem read plane (`services/prom-compat/`, Track A) is a separate stack reading the same storage.--## Non-goals (deliberately deferred)--1. Schema rewrite to the streams-table pattern (Snuffle benchmarks: ~10× disk on metrics, ~5× on logs).- The seam for that rewrite is the `attribute_field()` helper introduced in P0.-2. PromQL / `prom-compat` service — separate stack, already designed.-3. SDK swap (replacing `prom-client` in `nodejs/src/...` with OTel SDK).-4. Deploy-annotation automation from Helm release events.--## What's already in place (do not re-build)--**Ingest data plane** — shipped or in-flight:--- `rust/capture-logs/`: OTLP/HTTP receiver at `/v1/metrics` (and `/i/v1/metrics`), JSON or protobuf, writes to Kafka. `rust/capture-logs/src/main.rs:154-160`, `src/service.rs:703-820`.-- `nodejs/src/metrics-ingestion/metrics-ingestion-consumer.ts`: drains Kafka into ClickHouse with quota + ratelimit (`MetricsRateLimiterService`).-- ClickHouse `metrics1` table (OTel-shaped, gauge / sum / histogram / exp-histogram / summary), MVs into `metric_attributes`. `posthog/clickhouse/metrics/metrics1.py`. Registered in `posthog/clickhouse/schema.py:332-333`.-- `charts` (in-flight `daniel/metrics-prod-rollout`): WarpStream metrics cluster + `kafka.metricsBrokers` on capture-logs + `/i/v1/metrics` Contour ingress + `metrics-ingestion` deployment, prod-us + prod-eu.-- `posthog-cloud-infra`#8321/8322/8415/8434/8489 (merged): Kafka topics + S3 bucket + IRSA + CH named collection + Postgres app user.-- `argocd/otel-collector/` (daemonset, already deployed): an existing OTel Collector with `prometheus` + `otlp` receivers and a `metrics` pipeline whose exporter today is `debug`.--**Product surface — alpha (gated by `FEATURE_FLAGS.METRICS`):**--- `products/metrics/backend/facade/api.py`: `team_has_metrics(team)`, `query_metric(team, metric_name, aggregation, date_from, date_to)`, `list_metric_names(team, search, limit)`.-- `products/metrics/backend/metric_query_runner.py`: single-metric runner, aggregations `sum | avg | count | p95`, auto-bucketed to ~60 points.-- `products/metrics/frontend/MetricsScene.tsx`: Viewer tab (single-metric) + HogQL SQL editor over `posthog.metrics`.--## Gap to close--| | Today | Target |-| --------------------- | -------------------------------- | ------------------------------------------------------------------------------------ |-| Filters | none (metric name + agg only) | label / attribute predicates with explicit scope (`resource` / `attribute` / `auto`) |-| Group-by | none | shared interval grid, multi-series response |-| Aggregations | sum / avg / count / p95 | + `rate`, `increase`, `histogram_quantile` |-| Multi-metric | one clause | N clauses + server-side HogQL formula |-| Storage seam | direct `attributes_map_str[...]` | `attribute_field(name)` helper used everywhere |-| Wire shape | `[{time, value}]` | `[{labels, points}]` — stable from PR2 |-| Dashboard widget | none | `metric_timeseries` widget type |-| Dashboard variables | n/a | dashboard filters propagate into widget config |-| Annotations | n/a | PostHog Annotations render as vertical lines on metric widgets |-| Scraped infra metrics | not flowing | existing collector's metrics pipeline exports to capture-logs |-| MCP | none | follow-on, not in this MVP |--## Architecture (target)--```text-[ envoy /stats/prometheus ] [ posthog services /metrics ]-[ kminion /metrics ] ──scrape──> [ otel-collector daemonset ] ──OTLP/HTTP──> capture-logs /i/v1/metrics-[ kube-state-metrics, cadvisor ] [ prometheus receiver ] │-[ node-exporter ] [ otlphttp/posthog exporter ] │- ▼- Kafka- │- ▼- metrics-ingestion-consumer- │- ▼- ClickHouse metrics1 (logs cluster)- │- ┌───────────────────────────────────────────────────────────┴────────────────────────────────────┐- ▼ ▼- products/metrics facade services/prom-compat (Track A, separate)- (HogQL on metrics1 — this stack) (PromQL on metrics1)- │ ▲- ▼ │- MetricsScene + metric_timeseries widget Grafana / alertmanager / promtool-```--## The stack--The stack is split into small PRs, each <400 LOC including tests. Each is a separate `gt create` on top of the previous.--### Phase 0 — Foundations (no user-visible change, lock the seams)--| # | Repo | PR | Notes |-| ------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |-| **P0** | posthog | `attribute_field(name) -> ast.Expr` helper + `seed_metric(team, name, points, labels)` pytest fixture | Schema-rewrite seam (see Non-goal 1) + deterministic test data. |-| **P1** | posthog | `MetricQueryClause`, `MetricQueryRequest`, `MetricSeries`, `Point` frozen dataclasses in `products/metrics/backend/facade/contracts.py`. Facade stub raises NotImplementedError for unimplemented fields. | Locks the target wire shape from PR1 onward — no schema churn through P3-P7. |-| **P2** | posthog | DRF serializer + viewset accepts new request shape, returns `[MetricSeries]` (length-1 today). Regenerate TS types via `hogli build:openapi`. Old single-metric viewer kept on the legacy code path with a deprecation TODO. | After this PR every later backend PR regenerates TS types. |--### Phase 1 — Charts infra: turn on the existing collector's metrics pipeline--| # | Repo | PR | Notes |-| ----------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |-| **INFRA-A** | charts | Add `otlphttp/posthog-metrics` exporter and a scoped `scrape_configs` block to the existing `argocd/otel-collector/` daemonset. **Dev cluster only**, scrape only the dashboard's targets (envoy capture-logs cluster, kminion ingestion-(logs\|traces) group, kube-state for capture-logs + logs-ingestion + metrics-ingestion + ingestion-(logs\|traces) deployments). Dual-write with `debug` exporter so the data flow can be inspected on day one. | Per-target list is the cardinality guardrail — no namespace wildcard. |-| **INFRA-B** | posthog | Add an `internal-infra` exemption (or a generous fixed quota) for the project token used by the otel-collector to `posthog/nodejs/src/metrics-ingestion/services/metrics-rate-limiter.service.ts`. | Without this the cluster's own metric traffic counts toward customer quota. |-| **INFRA-C** | charts | Cut `otlphttp/posthog-metrics` over from dual-write to single-write (drop `debug`). Dev only. | Validation gate before prod. |-| **INFRA-D** | charts | Replicate INFRA-A + INFRA-C to `values.prod-us.yaml` and `values.prod-eu.yaml`. | Lands after `daniel/metrics-prod-rollout` merges and CH `metrics1` is applied in prod. |-| **INFRA-E** | charts | Broaden scrape config to the remaining targets the full dashboard needs (`capture-logs`, `logs-ingestion`, `metrics-ingestion` `/metrics` endpoints once SDK side is verified). | Gates on P9 (UI can render) so we can sanity-check live. |--### Phase 2 — Query layer (PostHog repo)--| # | Repo | PR | Notes |-| ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |-| **P3** | posthog | Label filters (`eq`, `neq`, `regex`) on a single clause with explicit `scope: resource \| attribute \| auto`. Uses `attribute_field()` from P0. | First feature flag that requires real data — INFRA-A is the source. |-| **P4** | posthog | `group_by` on a single clause, with a fixed interval grid shared by every series in the response. | Interval is on `MetricQueryRequest`, not per clause (single-grid invariant). |-| **P5** | posthog | `rate` + `increase` aggregations. `runningDifference()` + `clamp_min(..., 0)` for counter-reset handling. Consumes `aggregation_temporality` to skip the diff for delta inputs. | Most panels are rate-based — getting this wrong shows up in every dashboard. |-| **P6** | posthog | `histogram_quantile`. Bounds-equality check inside a group; mismatches drop with a logged warning. Uses `histogram_bounds` / `histogram_counts` arrays from `metrics1`. | P95 latency panel + every histogram-based SLO. |-| **P7** | posthog | Multi-clause query + server-side HogQL formula. Per-clause result joined on time bucket; formula evaluated against named clauses (`(a - b) / a`). | Server-side only — no client-side alignment. |--### Phase 3 — Viewer + widget (PostHog repo)--| # | Repo | PR | Notes |-| ------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |-| **P8** | posthog | `MetricsViewer` — multi-series chart rendering, label-filter UI (consumes the P2 contract). | First UI delivery — every later UI consumes the same code path. |-| **P9** | posthog | `MetricsViewer` — group-by selector + formula expression input. | Full Viewer parity. |-| **P10** | posthog | `metric_timeseries` widget registry entry (`validate_config`, `query_fn`) reusing the metrics facade. Add to `WIDGET_REGISTRY` and `EXPECTED_WIDGET_TYPES` in `products/dashboards/backend/widget_registry.py`. | No new facade method allowed — if the widget reaches for one, the gap is in the viewer's exercise. |-| **P11** | posthog | `metric_timeseries` widget frontend — WidgetCard + catalog entry + config form. | Widget lives in dashboards UI. |-| **P12** | posthog | Dashboard variables / filters → metric widget filter injection (`$service`-equivalent). | Replicates the Grafana variable UX. |-| **P13** | posthog | PostHog Annotations rendered as vertical lines on metric widgets. | Replaces Grafana's "Deploys" annotation. |--### Out of stack (separate plans)--- Streams-table schema rewrite — large project, the `attribute_field()` seam is the entry point.-- prom-compat (Track A) — see `docs/internal/prom-compat/design.md`.-- `prom-client` → OTel SDK swap in PostHog services.-- Deploy annotation automation from Helm release events.--## Sequencing rules--1. **P0 + P1 land before any infra PR.** Real data should not hit `metrics1` at scale before the storage seam (`attribute_field`) and the contract dataclasses are merged — once data exists, you can't undo it cheaply.-2. **INFRA-A..C land between P2 and P3.** P3+ tests run against dev `metrics1` with real OTLP-ingested rows, not synthetic ones, to catch resource-vs-attribute bugs that fixtures miss.-3. **INFRA-A and INFRA-E are different PRs on purpose.** Narrow scrape in dev first; broad scrape only after the query layer can handle it. Resist the temptation to merge them "to save a PR" — that's how storage bloats 5-10× before the schema rewrite lands.-4. **Widget PRs (P10+) must not introduce any new facade method.** If you reach for one, the gap is in the viewer's exercise of the contract — go fix it in P3-P9.--## Local verification path--`hogli dev:setup` → select **`metrics`** intent (`devenv/intent-map.yaml:99-101`). This boots `capture-logs`, `ingestion-metrics`, and the dependencies. `metrics1` is created by the standard CH bootstrap.--Per-PR sanity checks:--- **P0–P2**: `hogli test products/metrics/backend/tests/` + `curl POST /api/projects/2/metrics/query` (new shape). HogQL SQL tab in `/metrics` works against `posthog.metrics` from day one.-- **P3–P7**: curl + JSON. UI does not show new features until P8/P9.-- **P8+**: browser at `/metrics` (alpha flag on).-- **P11+**: browser at `/dashboard/...` — add a `metric_timeseries` tile.--Seeder script for ad-hoc dev data (no PRs needed):--```bash-clickhouse-client -h localhost --query "-INSERT INTO metrics1 (uuid, team_id, timestamp, service_name, metric_name, metric_type, value, attributes_map_str, resource_attributes)-SELECT generateUUIDv4(), 2, now() - INTERVAL number SECOND, 'capture-logs', 'envoy_5xx_total', 'sum',- toFloat64(number * 0.1),- map('container__str', 'capture-logs', 'envoy_response_code_class__str', '5'),- map('namespace', 'posthog')-FROM numbers(3600)"-```--## Known footguns the stack pre-empts--- Two-grid formulas → P1's `MetricQueryRequest` enforces a single interval shared by every clause.-- Naive `rate()` over a pod restart → P5 uses `clamp_min(runningDifference(value), 0)`.-- Histogram aggregation across mismatched bounds → P6 validates bounds equality within a group.-- `attributes_map_str['foo']` everywhere → P0's `attribute_field()` helper is the only call site.-- Two response shapes (single vs multi series) → P2 returns `[MetricSeries]` from day one, length-1 if no group-by.-- Quota throttling on internal infra traffic → INFRA-B carves an exemption.-- Scraping the whole namespace → INFRA-A scopes to the exact targets the dashboard needs.-- Cumulative vs delta confusion → `aggregation_temporality` checked in P5 before applying `runningDifference`.--## Open decisions (need owner input)--1. **Internal-infra project** — which project receives scraped cluster metrics in each environment? Recommend a dedicated `posthog-internal-infra` project with its own `team_id` so `team_has_metrics` doesn't flip on the dogfood project. Cap budget separately from customer billing.-2. **Naming convention** — keep Prometheus `snake_case_total` for scraped metrics (preserves dashboard expressions) and use OTel dotted (`http.server.duration`) for new SDK-emitted metrics. Document; do not mix.-3. **Token sensitivity** — existing `argocd/otel-collector/values/values.dev.yaml` exposes `Bearer sTMFPsFhdP1Ssg` in plain YAML for the traces pipeline. Confirm: that's a project public capture token, not a personal API key. Apply the same model to the new `otlphttp/posthog-metrics` exporter.diff --git a/docs/internal/metrics/deployment-layout.md b/docs/internal/metrics/deployment-layout.mddeleted file mode 100644index d4e59939010e..000000000000--- a/docs/internal/metrics/deployment-layout.md+++ /dev/null@@ -1,105 +0,0 @@-# Metrics — deployment layout (local / dev / prod-us / prod-eu / charts)--Companion to [`dashboard-mvp.md`](./dashboard-mvp.md). This is the "what has to exist where" checklist for metrics to be fully functional, plus the schema decision.--## Schema decision (settled)--**Alpha ships on the current `metrics1` table.** The streams-table layout (Snuffle's default schema: `metrics_series` id→labels + `metrics_samples` id,ts,value + inverted `metrics_label_index`) is the **post-alpha storage track**, not a blocker.--Why this is safe and correct for a days-to-alpha timeline:--- Snuffle's `create_metrics_posthog_schema.sql` is **our current `metrics1` verbatim** — Rory built his PromQL bridge to read our existing table. So prom-compat works against `metrics1` as-is; we lose nothing by not migrating first.-- The streams layout is the _eventual_ target (Snuffle benchmarks ~89.5% less disk, ~31→3 bytes/sample) but it changes the ingestion write path + adds a backfill — too much risk to land under an alpha deadline.-- The `attribute_field()` helper (P0) is the migration seam: when storage moves to streams, only that one function changes, not every query call site.--**Action when we do the storage track:** model `metrics_series` keyed by a full series fingerprint — Snuffle computes it as `cityHash64(metric_name, service_name, mapSort(resource_attributes), mapSort(attributes_map_str))`. We already materialize a partial `resource_fingerprint = cityHash64(resource_attributes)` on `metrics1`; the full series identity adds metric_name + service_name + sorted data-point attributes.--## The full data path (all environments)--```text-producers ─► capture-logs /i/v1/metrics ─► Kafka (WarpStream "metrics") ─► metrics-ingestion consumer ─► ClickHouse metrics1 (logs cluster)- │ │- ├─ app SDKs (OTLP, customer traffic) ▼- └─ infra/service metrics via vmagent ─► otel-collector bridge (prometheusremotewrite→OTLP) products/metrics (HogQL) + prom-compat (PromQL)-```--Two producer classes:--1. **Customer OTLP** — apps push OTLP straight to `/i/v1/metrics`. Already works in every env where the ingest path is live.-2. **Our own infra/service metrics** — vmagent already scrapes them; the otel-collector bridge (INFRA-A) fans a copy into `/i/v1/metrics`. This is the "pipe our logs services through" path.--## Status matrix — what exists where--Legend: ✅ live · ⏳ in-flight (PR) · ➕ this stack adds it · — n/a--| Layer | local | dev | prod-us | prod-eu | Where it lives |-| -------------------------------------------------------- | ----------------- | ----------------- | ------------- | ------------- | ---------------------------------------------- |-| Kafka topics (`ingestion_metrics`, `clickhouse_metrics`) | ✅ (compose) | ✅ | ✅ | ✅ | cloud-infra #8321 |-| WarpStream metrics cluster + S3 + IRSA | — | ✅ | ⏳ | ⏳ | charts `warpstream-metrics`; cloud-infra #8322 |-| CH named collection `warpstream_metrics` | — | ✅ | ✅ | ✅ | cloud-infra #8415/#8489 |-| metrics-ingestion Postgres app user | ✅ | ✅ | ✅ | ✅ | cloud-infra #8434 |-| capture-logs `kafka.metricsBrokers`/`metricsTopic` | ✅ (compose) | ✅ | ⏳ | ⏳ | charts `capture-logs` (global in rollout) |-| Contour ingress `/i/v1/metrics` | ✅ (caddy) | ✅ | ⏳ | ⏳ | charts `contour-ingress` |-| metrics-ingestion consumer deploy | ✅ (mprocs) | ✅ | ⏳ | ⏳ | charts `logs/metrics-ingestion` |-| ClickHouse `metrics1` + MVs | ✅ (CH bootstrap) | ✅ | ⏳ direct SQL | ⏳ direct SQL | `posthog/clickhouse/metrics/` |-| **otel-collector bridge** (infra→metrics1) | ➕ local recipe | ➕ INFRA-A #11808 | ➕ INFRA-D | ➕ INFRA-D | charts `otel-collector` + `vmagent` |-| Rate-limit/quota exemption for internal-infra token | — | ➕ INFRA-B | ➕ INFRA-D | ➕ INFRA-D | `nodejs/.../metrics-rate-limiter.service.ts` |-| Feature flag `METRICS` + `metrics:read` scope | ✅ code | ✅ code | ✅ code | ✅ code | posthog repo (all envs share) |-| Query layer (filters/group-by/rate/hist/formula) | ➕ this stack | ➕ | ➕ | ➕ | `products/metrics/backend` |--**Read:** the ingestion data plane is **done in dev**, and **pending in prod** behind `daniel/metrics-prod-rollout` (charts) + the post-merge `metrics1` SQL apply on the prod-us/prod-eu logs CH clusters. cloud-infra scaffolding (topics/S3/IRSA/CH collection/PG user) is **merged in all three envs**.--## What still has to be added, by repo--### posthog (this stack)--- Query layer: `MetricQueryRequest`/`MetricSeries` contracts → endpoint → shared metric-math library (filters, group-by, rate, increase, histogram_quantile, formula). **This is the product gap; nothing else replaces it.**-- INFRA-B: internal-infra token quota exemption in `MetricsRateLimiterService`.-- (Post-alpha) Alerting on the shared math library; streams-table storage migration.--### charts--- INFRA-A (#11808, dev): otel-collector `prometheusremotewrite` bridge + vmagent second remote-write. **Draft up.**-- INFRA-C (dev): drop the `debug` exporter once metrics1 arrival is confirmed.-- INFRA-D (prod-us + prod-eu): replicate the bridge after `metrics-prod-rollout` merges and prod `metrics1` SQL is applied. Decide internal-infra project here.-- INFRA-E: broaden the bridge filter beyond the initial dashboard metric set once the query layer can render more.-- (Merge) `daniel/metrics-prod-rollout`: takes the ingestion data plane to prod-us + prod-eu.--### posthog-cloud-infra--- **Nothing new required** for alpha — topics/S3/IRSA/CH collection/PG user are all merged in every env.-- Open decision (INFRA-D): provision a dedicated `posthog-internal-infra` project + token per env so scraped infra metrics don't flip `team_has_metrics` on the dogfood team and so internal-infra volume is billed/quota'd separately.--### Per-env "go live" checklist for prod--1. Merge `daniel/metrics-prod-rollout` (charts).-2. Apply `metrics1` + MV DDL to prod-us and prod-eu logs CH clusters (direct SQL, as in dev).-3. Point a smoke OTLP producer at the prod `/i/v1/metrics`; confirm rows in `metrics1`.-4. Land INFRA-D (bridge) per env; confirm vmagent → bridge → metrics1 for the dashboard metric set.-5. Verify `team_has_metrics` + the query layer against real prod series.--## Local validation (the priority) — fully functional metrics on a laptop--No charts/cloud-infra needed locally. The `metrics` dev intent boots the whole pipe, and the dev `otel-collector` container **already scrapes our logs services and pushes them into `metrics1`** — no manual collector to run.--1. `hogli dev:setup` → select the **`metrics`** intent (boots `capture-logs`, `ingestion-metrics`, `ingestion-logs`, the dev `otel-collector`, deps; `metrics1` created by CH bootstrap). `hogli start`.-2. Enable the `metrics` feature flag for your user.-3. Real PostHog logs services pipe through automatically: the dev collector (`otel-collector-config.dev.yaml`) scrapes `/_metrics` on `logs-ingestion` (`:6743`), `metrics-ingestion` (`:6744`), and the plugin server (`:6738`) every 15s and exports OTLP to `capture-logs` (token `phc_local` → `team_id` 1). Their `prom-client` counters (`logs_ingestion_*`, `metrics_ingestion_*`, consumer lag, batch utilization) are exactly the Grafana logs-dashboard metrics.-4. Validate:- - `bin/verify-metrics-pipe` — checks `metrics1` for the piped service metrics and prints what arrived (pass/fail with troubleshooting).- - `/metrics` SQL tab: `SELECT metric_name, count() FROM posthog.metrics WHERE service_name = 'logs-ingestion' GROUP BY 1 ORDER BY 2 DESC` (note: data lands on **team_id 1** via `phc_local`).- - `/metrics` Viewer: the query layer (filters/group-by/rate/histogram_quantile) against the same data.--Ad-hoc seed without the pipe (no PRs needed):--```bash-clickhouse-client -h localhost --query "-INSERT INTO metrics1 (uuid, team_id, timestamp, service_name, metric_name, metric_type, value, attributes_map_str, resource_attributes)-SELECT generateUUIDv4(), 2, now() - INTERVAL number SECOND, 'logs-ingestion', 'logs_ingestion_bytes_received_total', 'sum',- toFloat64(number * 1024),- map('container__str','logs-ingestion','team_id__str','2'),- map('namespace','posthog')-FROM numbers(3600)"-```--(`team_has_metrics` caches for 7 days — after wiping CH, `cache.delete("team:2:has_metrics")`.)diff --git a/posthog/clickhouse/metrics/metric_events.py b/posthog/clickhouse/metrics/metric_events.pyindex aee92ff617eb..1eca27c97066 100644--- a/posthog/clickhouse/metrics/metric_events.py+++ b/posthog/clickhouse/metrics/metric_events.py@@ -17,7 +17,7 @@ from posthog.clickhouse.table_engines import Distributed, MergeTreeEngine, Repla# the canonical label set and ships it in the Avro payload); the ingest MVs store it# verbatim and never recompute it. This is the TSDB / Snuffle-default approach — the# storage engine must not compute identity, or two independent MVs diverge (and the-# stored-map MV context corrupts the hash). See docs/internal/metrics for the history.+# stored-map MV context corrupts the hash).## Distinct from `metrics1` (pre-aggregated rollups for dashboards/alerts): this# keeps every raw sample, for exact quantiles, per-emission drill-down, and the