File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ services:
5555 restart : unless-stopped
5656 volumes :
5757 - ./config/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
58+ - ./config/alerts:/etc/prometheus/alerts:ro
5859 - prometheus_data:/prometheus
5960 command :
6061 - --config.file=/etc/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change 1+ # Prometheus alert rules for the stack itself plus RED-style alerts on the
2+ # span metrics Tempo derives from traces. Evaluated by Prometheus; visible in
3+ # Grafana under Alerting → Alert rules (Prometheus datasource).
4+ # No Alertmanager: single-host stack, alerts are surfaced in Grafana.
5+ # Validated by `just check` (promtool check rules).
6+
7+ groups :
8+ - name : stack-health
9+ rules :
10+ - alert : TargetDown
11+ expr : up == 0
12+ for : 2m
13+ labels :
14+ severity : critical
15+ annotations :
16+ summary : " Scrape target {{ $labels.job }} is down"
17+ description : " Prometheus cannot scrape {{ $labels.instance }} (job {{ $labels.job }}) for 2 minutes."
18+
19+ - alert : OtelExportFailures
20+ expr : sum by (exporter) (rate(otelcol_exporter_send_failed_spans_total[5m])) > 0
21+ or sum by (exporter) (rate(otelcol_exporter_send_failed_metric_points_total[5m])) > 0
22+ or sum by (exporter) (rate(otelcol_exporter_send_failed_log_records_total[5m])) > 0
23+ for : 5m
24+ labels :
25+ severity : warning
26+ annotations :
27+ summary : " OTel Collector failing to export via {{ $labels.exporter }}"
28+ description : " The collector has been failing to deliver telemetry to a backend for 5 minutes. Check `just logs otel-collector`."
29+
30+ - name : service-red
31+ rules :
32+ - alert : HighErrorRate
33+ expr : >
34+ sum by (service) (rate(traces_spanmetrics_calls_total{status_code="STATUS_CODE_ERROR"}[5m]))
35+ / sum by (service) (rate(traces_spanmetrics_calls_total[5m])) > 0.05
36+ for : 5m
37+ labels :
38+ severity : warning
39+ annotations :
40+ summary : " {{ $labels.service }} error rate above 5%"
41+ description : " More than 5% of spans from {{ $labels.service }} report errors (from Tempo span metrics)."
Original file line number Diff line number Diff line change 44 external_labels :
55 origin : monitoring-host
66
7+ rule_files :
8+ - /etc/prometheus/alerts/*.yaml
9+
710# Apps push metrics via OTLP (through the collector). Scrape only infra we host.
811scrape_configs :
912 - job_name : prometheus
You can’t perform that action at this time.
0 commit comments