# alerting Prometheus rules and the shared Alertmanager config for Quillon Health. The observability team owns this repo. Service teams file `OBS-` tickets against it and review changes to their own rules. Alertmanager is shared with the platform and data Prometheus servers, so most team subtrees route alerts that don't come from here. ## Where things live | what | where | authoritative for | |---|---|---| | alerting and recording rules | `rules/` | | | routing, receivers, inhibition | `alertmanager/alertmanager.yml` | | | SLO catalog | `slo/services.yaml` | targets, SLO windows, SLI families, traffic floors | | who owns what | `teams/ownership.yaml` | team of every service (wins over anything a runbook says) | | policies | `docs/adr/` | burn-rate policy, scrape intervals, disk alerts | | runbooks | `runbooks/*.md` | what an alert is for and how fast it has to page | | incident packets | `incidents/` | times: PagerDuty and postmortems win; Slack is local time and sometimes a minute out | | smoke tests | `tests/visible/` | just the smoke suite, not a spec | `bin/af-check` is CI (promtool check, the smoke tests, amtool check-config). `bin/range2test` turns a `query_range` pull from an incident packet into a promtool test so you can replay it against a branch. Some files are older than the conventions here. Leave their formatting alone unless you are changing them for a reason. Every group runs at the global evaluation interval of 1m: no `interval:`, `query_offset:` or `limit:` on a group. No rule reads `ALERTS` or `ALERTS_FOR_STATE`, except an alert that keeps its own firing series up. If one alert should silence another, write an inhibition rule in Alertmanager so on-call can see it. No symlinks anywhere in the repo: the deploy job rejects them. Copy the file instead. ## What this Prometheus sees What we can see from here: our apps and the ingress. App targets are relabelled with `service` (the Kubernetes Service name) and `pod`; `up{service="…"}` lists a service's targets. Platform runs the Prometheus with the kubelet and kube-state-metrics in it, and we don't alert from that one. They federate a few cAdvisor container series into ours (`container_memory_*`, `container_spec_*`, `container_cpu_*`), and nothing from kube-state-metrics. The vendor's synthetic checks only watch the public homepage, so liveness here means `up` and the services' own request counters. Per-job scrape intervals: ADR 0002. Rate windows are sized at roughly four scrape intervals. ## Paging policy `page` wakes someone up. `critical` is the older spelling of `page`: it routes and pages the same way, and new rules use `page`. `warning` pages nobody. Generation-1 files still have a few two-tier alerts with a `warning` and a `critical` copy. We page when users are hurt now, or will be within the hour, and whoever gets paged can act on it. Everything else is a ticket (`severity: ticket`), which lands in the owning team's queue. ## Kinds of alerts Service alerts are `HighErrorRatio`, `Down` and the burn alerts. They page the team that owns the service, and error alerts are per service, not per pod, so an outage is one page per service. Window 5m, `for: 10m`. Only 5xx count as errors; a 4xx is the caller's problem. Capacity alerts (`ContainerMemoryNearLimit`, disk) are tickets for the owning team unless an ADR makes a level page (disk: ADR 0013). `ContainerMemoryNearLimit` is for a container that keeps hitting 90% of its memory limit for 10 minutes, not for one busy 5-minute stretch, and the ticket should be open within 20 minutes of the first time it hits 90%, well before the OOM. Fleet alerts (node, database, cache and broker exporters) belong to `infra`, are `severity: warning`, and page nobody. All other alerts keep their `severity` and `team` unless a ticket asks for a change. Ticket alerts carry `service`, same as pages. Labels on every alert: `severity`, `team`. Service, capacity and ticket alerts carry `service` as well, from the expression or set statically. Annotations: a `summary` naming what is affected, and a `runbook_url`. ## Service health `Down` (for `checkout-api`: `CheckoutApiDown`) is the only Down alert a service has. Lose the last healthy target, or lose the targets altogether, and the owning team is paged within 10 minutes; a restart that takes targets away for at most 2 minutes doesn't page. Labels `severity: page`, `team`, `service`. ## SLIs and burn alerts - SLI records: `slo:sli_error:ratio_rate`, windows 5m, 30m, 1h and 6h, the bad fraction `by (service)` across every service that emits the family's metrics (no per-service filter). - Latency SLIs: `slo:sli_latency:ratio_rate`, one per service because objectives differ per service. - Burn alerts read only their own service's SLI records: `ErrorBudgetBurnFast` (`for: 2m`, `severity: page`), `ErrorBudgetBurnSlow` (`for: 15m`, `severity: ticket`), labelled `severity`, `team`, `slo: -availability`. - Burn factors: ADR 0006. SLO window: `slo/services.yaml`. ## Routing The `team` label on the alert is the routing key and has to match `teams/ownership.yaml`. Each team has a subtree matching its `team`: - `page` and `critical`: `pagerduty-`, `slack-`, `slack-sre-fyi` - `ticket`: `jira-`, `slack-` - `warning`: `slack-` SRE watches every page in #sre-fyi (`slack-sre-fyi`); nobody is paged from there. The root receiver `slack-alerts-default` is the catch-all for alerts with no `team`; nobody is on it. Rule evaluation failures go to `slack-prometheus-meta`. The paging unit is the service: one page per service per outage; two services failing together are two pages, even for the same team. Don't change receivers you don't own, `global`, or add time intervals. ## Inhibition rules Inhibitions between service alerts use `equal: [service]`: an outage of one service must never mute another service's alerts. The critical copy of an alert holds back its warning copy, same alert and same service, with `equal: [alertname, service]`. Cluster level: `ClusterUnreachable` (no `service` label) pages platform through `pagerduty-platform`; while it is firing, service pages from that cluster stay held back, `equal: [cluster]`. ## Runbooks Runbook links point at `https://runbooks.quillon.example/alerts/`. That site is generated from `runbooks/*.md` here; a page's front matter lists the alerts it covers. ## Contacts - Questions: #obs-help. Office hours Tuesday and Thursday afternoons. - Urgent routing problems out of hours: the SRE rota (`pagerduty-sre`). - Reviews: observability for anything under `alertmanager/`; the owning team for its rules.