Files

16 lines
1.8 KiB
JSON

{
"id": "prometheus-targets-and-rules",
"kind": "terminal",
"sourceRevision": "16c337bcc91b27ac0f074154b8337e4c8dc17ebb",
"executedAt": "2026-09-20T14:39:48+09:00",
"command": "kubectl -n observability port-forward svc/observability-core-kube-pr-prometheus 19090:9090 >/dev/null 2>&1 & sleep 4; curl -s \"http://127.0.0.1:19090/api/v1/targets?state=active\" | python3 -c \"import sys,json;d=json.load(sys.stdin)[\\\"data\\\"][\\\"activeTargets\\\"];print(\\\"activeTargets:\\\",len(d));print(\\\"up:\\\",sum(1 for t in d if t[\\\"health\\\"]==\\\"up\\\"))\"; curl -s \"http://127.0.0.1:19090/api/v1/rules\" | python3 -c \"\nimport sys,json\ng=json.load(sys.stdin)[\\\"data\\\"][\\\"groups\\\"]\na=sum(1 for x in g for r in x[\\\"rules\\\"] if r[\\\"type\\\"]==\\\"alerting\\\")\nc=sum(1 for x in g for r in x[\\\"rules\\\"] if r[\\\"type\\\"]!=\\\"alerting\\\")\nf=[r[\\\"name\\\"] for x in g for r in x[\\\"rules\\\"] if r.get(\\\"state\\\")==\\\"firing\\\"]\nb=[(x[\\\"name\\\"],r[\\\"name\\\"],r.get(\\\"health\\\")) for x in g for r in x[\\\"rules\\\"] if r.get(\\\"health\\\")!=\\\"ok\\\"]\nprint(\\\"groups:\\\",len(g),\\\"alertRules:\\\",a,\\\"recordingRules:\\\",c)\nprint(\\\"firing:\\\",f)\nprint(\\\"unhealthy:\\\",b)\"; pkill -f \"port-forward svc/observability-core-kube-pr-prometheus\"",
"cwd": "ssh desktop (donghyeon-System-Product-Name, 192.168.0.107)",
"exitCode": 0,
"rawPath": "evidence/raw/prometheus-targets-and-rules.txt",
"presentationPath": null,
"proves": "active target 30/30 healthy, alert rule 155·recording rule 86, firing 0",
"doesNotProve": "scrape 시점의 target 건강이며 155개 alert 조건을 각각 주입 시험했다는 뜻이 아니다",
"sha256": "927a91f0f90f62ef57729c1e5e9f42c45ab8168608df62e86aa777d95f0330d0",
"bytes": 96
}