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
22 lines
612 B
Bash
22 lines
612 B
Bash
#!/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}"
|