Skip to content

pg-regression-radar

Detects PostgreSQL query performance regressions and pinpoints which Kubernetes deployment caused them.

Try it in your browser Install How it works

PerformanceRegression
{
  "name": "argocd-my-app-1234567890-q8675309",
  "namespace": "production",
  "deployEventId": "argocd-my-app-1234567890",
  "queryId": 8675309,
  "queryText": "SELECT * FROM orders WHERE user_id = $1",
  "status": "Detected",
  "confidenceScore": 0.98,
  "meanLatencyBefore": 4.2,
  "meanLatencyAfter": 13.7,
  "latencyChangeFactor": 3.26,
  "externalCauseSuspected": false,
  "planDiffSummary": "root node changed from Index Scan to Seq Scan",
  "createdAt": "2026-08-11T12:35:00Z"
}

What a detection looks like. See the API reference.

The problem

Teams running Postgres on Kubernetes (CloudNativePG, Zalando, Crunchy, Percona...) deploy applications many times a day via GitOps (ArgoCD, Flux, Argo Rollouts). When query latency spikes, the first question in every post-mortem is:

Which deploy caused this?

Answered by hand, today

  • Open Grafana
  • Look at pg_stat_statements
  • Try to recall when the last deploy happened
  • Cross-reference timestamps by eye

Few tools connect those dots for you.

pg-regression-radar does.

Live detectionWatch a regression get caughtA deploy lands, latency steps up, and the change point is attributed to it.

Simulated data. Hover the chart to pause and inspect it, or inject a deploy.

ArchitectureFrom scrape to alertFour components turn pg_stat_statements and deploy webhooks into a single answer.

pg-regression-radar architecture Postgres and deploy sources feed the Collector and the Deploy Event Ingester, which write into an in-memory time-series store read by the Correlation Engine, which fires Alerting and, in manager mode, a PerformanceRegression status. A rolling schedule can also trigger the Correlation Engine directly, independent of any deploy. scrape webhook / watch samples deploy events on a schedule alert manager mode Postgres pg_stat_statements Deploy sources ArgoCD, Rollouts, Flux, K8s 01 Collector bounded in-memory series 02 Deploy event ingester normalised DeployEvent records Rolling schedule periodic, no deploy needed 03 Correlation engine E-divisive change point + Welch's t-test 04 Alerting Slack, Teams, PagerDuty, custom Regression status PerformanceRegression CRD

01 Collector

Scrapes pg_stat_statements on an interval and keeps a bounded in-memory time series per queryid.

02 Deploy Event Ingester

Receives webhooks from ArgoCD, Argo Rollouts, and Flux and stores normalised DeployEvent records.

03 Correlation Engine

Runs a real two-stage detection for every deploy event: E-divisive change-point location, then Welch's t-test confirmation.

04 Alerting

Fires a Slack-compatible webhook with the query text, latency before/after, change factor, and confidence score.

Where to go next

Licensed under Apache 2.0 — see LICENSE.