github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/production/loki-mixin-compiled-ssd/alerts.yaml (about) 1 groups: 2 - name: loki_alerts 3 rules: 4 - alert: LokiRequestErrors 5 annotations: 6 message: | 7 {{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}% errors. 8 expr: | 9 100 * sum(rate(loki_request_duration_seconds_count{status_code=~"5.."}[1m])) by (namespace, job, route) 10 / 11 sum(rate(loki_request_duration_seconds_count[1m])) by (namespace, job, route) 12 > 10 13 for: 15m 14 labels: 15 severity: critical 16 - alert: LokiRequestPanics 17 annotations: 18 message: | 19 {{ $labels.job }} is experiencing {{ printf "%.2f" $value }}% increase of panics. 20 expr: | 21 sum(increase(loki_panic_total[10m])) by (namespace, job) > 0 22 labels: 23 severity: critical 24 - alert: LokiRequestLatency 25 annotations: 26 message: | 27 {{ $labels.job }} {{ $labels.route }} is experiencing {{ printf "%.2f" $value }}s 99th percentile latency. 28 expr: | 29 namespace_job_route:loki_request_duration_seconds:99quantile{route!~"(?i).*tail.*"} > 1 30 for: 15m 31 labels: 32 severity: critical 33 - alert: LokiTooManyCompactorsRunning 34 annotations: 35 message: | 36 {{ $labels.namespace }} has had {{ printf "%.0f" $value }} compactors running for more than 5m. Only one compactor should run at a time. 37 expr: | 38 sum(loki_boltdb_shipper_compactor_running) by (namespace) > 1 39 for: 5m 40 labels: 41 severity: warning