Skip to content
NEWMarketplace and your team: sell what you build, and get plans and changes that are tested before you see them. See what is new

Library / Code, Git & Developer Tools

Code, Git & Developer Tools

Monitor KPI anomalies with Postgres, Slack, Gmail, GitHub and Claude

When you run it, it automates developer work with OpenRouter and Claude using GitHub, Gmail, Postgres, Slack.

What it does

# KPI Anomaly Watchdog Watches the numbers your business actually runs on, and when one of them breaks, sends a human an explanation instead of a red square. ## How it works Statistics decide whether something is an anomaly. The model only ever explains why. A Code node scores every metric against a 28-day median and median absolute deviation, adjusted for day of week, and that score is what raises the alert. The investigating agent runs afterwards, cannot change the verdict, and has no free-form SQL: five parameterised tools and nothing else. Its explanation then has to survive an evidence check. Two tool-backed findings, confidence at or above 0.6, a named cause, and zero invented metric keys. Fail any one and the alert still goes out, labelled unexplained. A model that errors out entirely does the same thing. The number was real before the model ran and it stays real afterwards. Every alert a human judges feeds Monday's precision report, which turns those judgements back into concrete threshold suggestions. ## Setup steps 1. Run sql/01-schema.sql against your Postgres 2. Insert your metrics into kpi_metrics, one row per number you care about 3. Replace ALERT_SLACK_CHANNEL and DATA_ONCALL_EMAIL in Detection Settings and Report Settings 4. Attach credentials to every node showing a warning 5. Run Collect On Demand daily for two weeks, or backfill kpi_observations, before switching detection on 6. Point your alert buttons at the Disposition Webhook. Without dispositions the Monday report has nothing to compute precision from It will be quiet for two weeks. Metrics with fewer than 14 days of history are not scored at all, and that is deliberate.

The steps

  1. Collect On Demand
  2. Collect Nightly 01:00
  3. Load Metric Registry
  4. Run Metric Query
  5. Build Observation
  6. Store Observation
  7. Recompute Baselines
  8. Summarise Baseline Coverage
  9. Record Baseline Run
  10. Only Thin Coverage
  11. Warn Thin History
  12. Detect Every Morning 07:00
  13. Detection Settings
  14. Fetch Latest Vs Baseline

58 steps in total.

Similar automations