: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.
Characterize how a metric behaves in a suspicious window compared to a healthy baseline. This is the FIRST call to make when investigating "metric X is rising/dropping — why?": one call answers how big the change is, exactly when it started, and which label values moved.
All parameters go inside query — top-level fields are rejected:
{ "query": { "metricName": "m", "anomalyFrom": "2026-01-01T00:00:00Z" } }
Required: metricName (exact — discover via metric-names-list first) and anomalyFrom (when things started looking wrong; the alert fire time works). anomalyTo defaults to now. The baseline defaults to the equal-length window immediately before anomalyFrom; pass baselineFrom/baselineTo to compare against a known-good period instead (e.g. same time yesterday).
The aggregation is auto-picked from the metric's OTel type (counter -> rate, gauge -> avg, histogram -> histogram_quantile 0.95); override with aggregation if you need a different lens. Use filters to scope to a service or region. candidateKeys controls which label keys are drilled into for the movers analysis — omit it to auto-discover.
Read the report in this order:
direction+change_ratio+anomaly_peak: how bad is it? (flatmeans the windows don't meaningfully differ — widen the anomaly window or check you have the right metric.)onset_time: when it started. Use this exact timestamp as the pivot for cross-signal correlation.top_movers: which label values changed. One label value moving alone (e.g. a single pod or shard) points at a localized culprit; everything moving together points at a shared cause upstream.series: the full baseline+anomaly time series if you need to eyeball the shape.
Then correlate: query logs (query-logs with the same service and a window around onset_time, severity error first) and traces (APM span tools, same service/window) to find what broke and its blast radius.