Monitoring & alerting
Collect numbers, judge them against rules, and wake the right person with the right context.
The CityScript
This is all there is to it. Change it in the editor and the city redraws.
%% M · Monitoring & alerting
%% Exporters expose numbers, Prometheus scrapes and judges them, Alertmanager routes, a person is paged.
city 48x32
district watched "Things being watched" 3,3..17,17
district watch "Observability" 22,3..45,17
building shop factory in watched "Shop app"
floor shop.f "App"
room shop.api service "API" port=8080
room shop.exporter worker "Metrics endpoint" port=9100
building db warehouse in watched "Database"
floor db.f "Postgres"
room db.pg database "Postgres" port=5432
room db.exporter worker "Postgres exporter"
building prom warehouse in watch "Prometheus"
floor prom.f "Metrics"
room prom.scrape worker "Scraper"
room prom.tsdb storage "Time series" port=9090
room prom.rules config "Alert rules"
building am tower in watch "Alertmanager"
floor am.f "Routing"
room am.route proxy "Routes and silences" port=9093
building grafana depot in watch "Grafana"
floor grafana.f "Dashboards"
room grafana.dash service "Dashboards" port=3000
building oncall depot in watch "On-call"
floor oncall.f "People"
room oncall.page service "Pager"
room oncall.chat service "Chat channel"
pipeline alert "Alert path" prom -> [evaluate] -> [group] -> [route] -> oncall
step prom "Prometheus notices that something is wrong"
step oncall "The person on call is told"
link shop.exporter -> prom.scrape "scrape" variant=dashed
link db.exporter -> prom.scrape "scrape" variant=dashed
link prom.rules -> am.route "firing alert" variant=emphasis
link grafana.dash -> prom.tsdb "PromQL"