Check SLOs
stormbreaker-prometheus checks what the service’s own metrics say over the run’s window: the platform view.
Given the parcels-metrics prometheus service with the following properties: | url | http://prom-east:9090,http://prom-west:9090 | | minimum-window | 30s |When the parcels stream is sent at 50 requests per secondAnd the run's traffic is completeThen within 30s the increase of http_server_requests_seconds_count over the run is at least 2000And within 30s the p99 of http_server_requests_seconds over the run is at most 0.5 secondsWhere the metrics are
Section titled “Where the metrics are”A Prometheus service is one logical service, and the Prometheus servers that hold its metrics in every region it runs in. Environments keep metrics in one of three ways, and each is a url, with a selector where a server holds more than the service:
Diagram: Where a service’s metrics are. Three ways an environment keeps metrics, in two regions, eu-1 and eu-2. Per app, per region: each app runs its own Prometheus in each region, as an HA pair, and the suite’s check asks the parcels team’s pair in each region, one replica of each. Per region: one shared Prometheus in each region scrapes every app, and the check asks each with a selector, app="parcels". Global: each region’s Prometheus feeds one global view, such as Thanos or Mimir, and the check asks that one endpoint with the selector.
1/3Per app, per region. Each app runs a Prometheus of its own in each region or zone, here an HA pair. The service lists the parcels team’s Prometheus in each region, its replicas separated by |, so a pair counts once. It needs no selector: the server holds only that app.
2/3Per region. One Prometheus in each region scrapes every app there. The service lists each region’s Prometheus, and a selector, app="parcels", picks the parcels team’s series out of everyone else’s.
3/3Global. One view holds every region: Thanos, Mimir, or a central Prometheus. The service lists that one endpoint, with a selector; a region matcher in it judges some regions only. Checks merge the same way whichever it is.
┌───────────────────────────────────────────────────────────────┐ │ ┌╌ eu-1 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┐ ┌╌ eu-2 ╌╌│╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┐ │ ╎ ╎ ╎ v ╎ │ ╎ ┌─ prometheus ───┐ ┌──────────┐╎ ╎ ┌─ prometheus ───┐ ┌──────────┐╎ │ ╎ │ parcels’ own: │<─┤ parcels │╎ ╎ │ parcels’ own: │<─┤ parcels │╎ │ ┌──>│ prom-0 | prom-1│ └──────────┘╎ ╎ │ prom-0 | prom-1│ └──────────┘╎ │ │ ╎ └────────────────┘ ╎ ╎ └────────────────┘ ╎ │ │ ╎ ╎ ╎ ╎ ╔═ suite ══╧═════════╗ │ ╎ ╎ ╎ ╎ ║ parcels-metrics ╟────┘ ╎ ╎ ╎ ╎ ║ p99 · increase ║ ╎ ┌─ prometheus ───┐ ┌──────────┐╎ ╎ ┌─ prometheus ───┐ ┌──────────┐╎ ║ ║ ╎ │ tracking’s own │<─┤ tracking │╎ ╎ │ tracking’s own │<─┤ tracking │╎ ╚════════════════════╝ ╎ │ │ └──────────┘╎ ╎ │ │ └──────────┘╎ ╎ └────────────────┘ ╎ ╎ └────────────────┘ ╎ ╎ ╎ ╎ ╎ └╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┘ └╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┘
┌───────────────────────────────────────────────────────────────┐ │ ┌╌ eu-1 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┐ ┌╌ eu-2 ╌╌│╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┐ │ ╎ ╎ ╎ v ╎ │ ╎ ┌─ prometheus ───┐ ┌──────────┐╎ ╎ ┌─ prometheus ───┐ ┌──────────┐╎ │ ╎ │ shared by every│<─┤ parcels │╎ ╎ │ shared by every│<─┤ parcels │╎ │ ┌──>│ app in eu-1 │ └──────────┘╎ ╎ │ app in eu-2 │ └──────────┘╎ │ │ ╎ │ │ ╎ ╎ │ │ ╎ │ │ ╎ │ │ ╎ ╎ │ │ ╎ ╔═ suite ══╧═════════╗ │ ╎ │ │ ╎ ╎ │ │ ╎ ║ parcels-metrics ╟────┘ ╎ │ │ ╎ ╎ │ │ ╎ ║ p99 · increase ║ ╎ │ │ ┌──────────┐╎ ╎ │ │ ┌──────────┐╎ ║ ║ ╎ │ │<─┤ tracking │╎ ╎ │ │<─┤ tracking │╎ ╚════════════════════╝ ╎ │ │ └──────────┘╎ ╎ │ │ └──────────┘╎ ╎ └────────────────┘ ╎ ╎ └────────────────┘ ╎ ╎ ╎ ╎ ╎ └╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┘ └╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┘
┌╌ eu-1 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┐ ┌╌ eu-2 ╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┐
╎ ╎ ╎ ╎
╎ ┌─ prometheus ───┐ ┌──────────┐╎ ╎ ┌─ prometheus ───┐ ┌──────────┐╎
╎ │ eu-1’s, or an │<─┤ parcels │╎ ╎ │ eu-2’s, or an │<─┤ parcels │╎
╎ │ agent writing │ └──────────┘╎ ╎ │ agent writing │ └──────────┘╎
╎ │ to the view │ ╎ ╎ │ to the view │ ╎
╎ │ │ ╎ ╎ │ │ ╎
╔═ suite ════════════╗ ╎ │ │ ╎ ╎ │ │ ╎
║ parcels-metrics ║ ╎ │ │ ╎ ╎ │ │ ╎
║ p99 · increase ║ ╎ │ │ ┌──────────┐╎ ╎ │ │ ┌──────────┐╎
║ ║ ╎ │ │<─┤ tracking │╎ ╎ │ │<─┤ tracking │╎
╚══════════╤═════════╝ ╎ │ │ └──────────┘╎ ╎ │ │ └──────────┘╎
│ ╎ └─────────┬──────┘ ╎ ╎ └─────────┬──────┘ ╎
│ ╎ │ ╎ ╎ │ ╎
│ └╌╌╌╌╌╌╌╌╌╌╌│╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┘ └╌╌╌╌╌╌╌╌╌╌╌│╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┘
│ │ │
│ v v
│ ╔═ global view ══════════════════════════════════╗
│ ║ Thanos, Mimir, or a central Prometheus ║
└─────────────────────>║ ║
╚════════════════════════════════════════════════╝
| Where the metrics are | url |
selector |
|---|---|---|
| Per app, per region. Each app runs a Prometheus of its own in each region or zone. | the app’s Prometheus in each region or zone | not needed |
| Per region. One Prometheus in each region scrapes every app there. | each region’s Prometheus | the app’s labels, like app="parcels" |
| Global. One view holds every region: Thanos, Mimir, or a central Prometheus. | the one global endpoint | the app’s labels; add a region matcher to judge some regions only |
# Per app, per region: the parcels team's own Prometheus, an HA pair in each region.Given the parcels-metrics prometheus service with the following properties: | url | http://parcels-prom-0.eu-1:9090\|http://parcels-prom-1.eu-1:9090,http://parcels-prom-0.eu-2:9090\|http://parcels-prom-1.eu-2:9090 |
# Per region: a shared Prometheus in each region.Given the parcels-metrics prometheus service with the following properties: | url | http://prom.eu-1:9090,http://prom.eu-2:9090 | | selector | app="parcels" |
# Global: one view of every region.Given the parcels-metrics prometheus service with the following properties: | url | http://thanos-query:9090 | | selector | app="parcels" |- Every server in
urlis summed. List each place the service’s series are kept once: a series kept in two listed servers is counted twice. - Replicas of one server are separated by
|. An HA pair scrapes the same targets, so a check asks the first replica that answers, and never adds the pair up. (In a Gherkin table, write the|as\|.) - A selector picks the service’s series. Without one, a check reads every series of the metric the server holds, which on a shared or global server is every app’s.
Checks combine the servers as one Prometheus would:
- Counters are summed.
- Histograms have their buckets summed first, and the quantile is then interpolated as
histogram_quantiledoes.
Percentiles are never averaged. Averaging the p99 of a fast region and a slow one understates the slow one: a merged p99 lands where the slow region’s requests are.
The window
Section titled “The window”A check judges the run’s window: from when the run opened to when its traffic was complete. Before then, the window runs to now. The query asks for the window at its end, so what came after the run does not count.
Close the window with the run's traffic is complete before checking. A window shorter than the service’s minimum-window (its scrape interval or more) is refused, however long the check waits: it cannot be judged honestly.
Patience
Section titled “Patience”within 30s is how long a check may keep asking. Scrape lag is waited out, not slept around: the check asks every two seconds until it holds, and then fails with what it last saw.