up
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Symbols Server CI / symbols-smoke (push) Has been cancelled
devportal-offline / build-offline (push) Has been cancelled
Some checks failed
Docs CI / lint-and-preview (push) Has been cancelled
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Export Center CI / export-ci (push) Has been cancelled
Symbols Server CI / symbols-smoke (push) Has been cancelled
devportal-offline / build-offline (push) Has been cancelled
This commit is contained in:
21
scripts/observability/slo-evaluator.sh
Normal file
21
scripts/observability/slo-evaluator.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# DEVOPS-OBS-51-001: simple SLO burn-rate evaluator
|
||||
|
||||
PROM_URL=${PROM_URL:-"http://localhost:9090"}
|
||||
OUT="out/obs-slo"
|
||||
mkdir -p "$OUT"
|
||||
|
||||
query() {
|
||||
local q="$1"
|
||||
curl -sG "${PROM_URL}/api/v1/query" --data-urlencode "query=${q}"
|
||||
}
|
||||
|
||||
echo "[slo] querying error rate (5m)"
|
||||
query "(rate(service_request_errors_total[5m]) / rate(service_requests_total[5m]))" > "${OUT}/error-rate-5m.json"
|
||||
|
||||
echo "[slo] querying error rate (1h)"
|
||||
query "(rate(service_request_errors_total[1h]) / rate(service_requests_total[1h]))" > "${OUT}/error-rate-1h.json"
|
||||
|
||||
echo "[slo] done; results in ${OUT}"
|
||||
Reference in New Issue
Block a user