/ci:prow-job-prometheusfrom ci
Downloads and queries in-cluster Prometheus TSDB snapshots from Prow CI job runs. Use to debug apiserver slowness, etcd latency, node resource exhaustion, or restarts with PromQL.
Ships in ci. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Most OpenShift e2e prow jobs that use and reach the gather-extra step save the in-cluster Prometheus
TSDB. Loading it locally lets you run PromQL against the cluster as it was during the run.
This is the way to answer "what was the apiserver/etcd/node doing at the moment tests failed".
Use this skill when:
These TSDB's can be quite large, so avoid bulk downloading when possible, this is for targeted investigations.
walfix if go isn't installed).
On macOS the podman VM only mounts paths under /Users. The default cache
~/.cache/prow-prometheus is fine, but /tmp fails with statfs ... no such file or directory.test-platform-results-public bucket over anonymous HTTPS.
Do not run gcloud auth login or change the user's gcloud account to reach them. The bucket
named test-platform-results (no -public) is private.<run>/artifacts/<step>/gather-extra/artifacts/metrics/
prometheus.tar.gz # replica prometheus-k8s-0 TSDB (prometheus.tar in older runs)
prometheus-k8s-1.tar.gz # replica prometheus-k8s-1 TSDB (prometheus-k8s-1.tar in older runs)
prometheus-tsdb-status.json # live head stats at gather time (series count, time range)
prometheus-targets.json # scrape targets and their health at gather time
job_metrics.json # a few precomputed queries
Both replicas scrape the same targets, so either works. The snapshot covers the whole run (install through gather), roughly 2–3 hours.
SKILL_DIR="${CLAUDE_PLUGIN_ROOT}/skills/prow-job-prometheus"
python3 "$SKILL_DIR/load_snapshot.py" "<prow-job-url>"
The script:
gather-extra snapshot (pass --step if several steps have one).--replica 1 for the other replica) into ~/.cache/prow-prometheus/<build_id>/.walfix (see below).quay.io/prometheus/prometheus in podman on the first free port from 9090, waits until ready.If fewer than about 80% of the live series loaded, try the other replica. Even at ~98%, the
series lost to corruption can be an entire target, e.g. one etcd member. If a target you need
shows no data (check count by (instance) (count_over_time(<metric>[4h]))), load the other
replica on another port (--replica 1 --port 9091) and query it with promql.py --url.
Why the WAL repair matters. The snapshot is copied from a running Prometheus, so the WAL
almost always has a corrupt page. Prometheus's built-in repair handles that by deleting
every WAL segment after the corruption and only logging a warning. A naively loaded snapshot
can silently lose 90%+ of its series, e.g. two of three apiservers or etcd members appear to
have no data. walfix keeps every record whose checksum verifies and skips only the corrupt
fragments, typically recovering ~98% of series. Never load a raw snapshot without it.
If you see Deleting all segments newer than corrupted segment in podman logs, the WAL was
not repaired.
Metrics timestamps are UTC. Anchor the window on something concrete from the run:
start_time/end_time) or the run's intervals files.node_cpu_usage_timeline for the run, whose first sample is about the start of e2e.up == 0 or a missing sample means the target stopped responding.python3 "$SKILL_DIR/promql.py" '<promql>' --url http://localhost:9090 \
--start 2026-10-13T14:30:00Z --end 2026-10-13T14:56:00Z --step 60 --label instance
python3 "$SKILL_DIR/promql.py" '<promql>' --time 2026-10-13T14:43:00Z # instant query
It prints a time-by-series table (columns ordered by peak value, --max-series to widen).
The Prometheus UI at the printed URL also works for ad hoc exploration.
Apiserver load and responsiveness
| Question | Query |
|---|---|
| In-flight requests per apiserver | sum by (instance) (apiserver_current_inflight_requests{job="apiserver"}) |
| Read vs mutating in flight | sum by (request_kind) (apiserver_current_inflight_requests{job="apiserver"}) |
| APF executing by priority level | sum by (priority_level) (apiserver_flowcontrol_current_executing_requests) |
| APF queued requests | sum by (priority_level) (apiserver_flowcontrol_current_inqueue_requests) > 0 |
| 429 rejections | sum by (priority_level, reason) (rate(apiserver_flowcontrol_rejected_requests_total[2m])) > 0 |
| Request latency p99 by verb | histogram_quantile(0.99, sum by (verb, le) (rate(apiserver_request_duration_seconds_bucket{verb!="WATCH",verb!="CONNECT"}[2m]))) |
| Apiserver unresponsive | up{job="apiserver"} and scrape_duration_seconds{job="apiserver"} (rising scrape time, then a gap) |
| Apiserver restarts | process_start_time_seconds{job="apiserver"} (a step change is a restart) |
etcd (healthy: WAL fsync p99 < 10 ms, backend commit p99 < 25 ms)
| Question | Query |
|---|---|
| WAL fsync p99 (ms) | 1000*histogram_quantile(0.99, sum by (instance, le) (rate(etcd_disk_wal_fsync_duration_seconds_bucket[1m]))) |
| Backend commit p99 (ms) | 1000*histogram_quantile(0.99, sum by (instance, le) (rate(etcd_disk_backend_commit_duration_seconds_bucket[1m]))) |
| Leader and leader changes | etcd_server_is_leader, etcd_server_leader_changes_seen_total |
| DB size | etcd_mvcc_db_total_size_in_bytes |
Nodes (node-exporter instance labels are node names, e.g. ip-10-0-60-161...)
| Question | Query |
|---|---|
| CPU cores by mode | sum by (mode) (rate(node_cpu_seconds_total{instance=~"<node>.*",mode!="idle"}[1m])) |
| CPU busy % | 100*(1-avg by (instance) (rate(node_cpu_seconds_total{mode="idle"}[1m]))) |
| Available memory | node_memory_MemAvailable_bytes |
| Page-cache thrashing | rate(node_vmstat_pgmajfault[1m]) with rate(node_disk_read_bytes_total[1m]) |
| Disk write latency (ms) | 1000*rate(node_disk_write_time_seconds_total[1m]) / rate(node_disk_writes_completed_total[1m]) |
| OOM kills | node_vmstat_oom_kill |
Pods and containers (node label on cAdvisor metrics)
| Question | Query |
|---|---|
| Top CPU containers on a node | topk(8, sum by (namespace, container) (rate(container_cpu_usage_seconds_total{node="<node>",container!="",container!="POD"}[2m]))) |
| Top memory containers on a node | topk(10, sum by (namespace, container) (container_memory_working_set_bytes{node="<node>",container!="",container!="POD"})) |
| Pod cgroup total on a node | container_memory_usage_bytes{node="<node>",id="/kubepods.slice"} |
| Disk reads by pod on a node | topk(8, sum by (namespace, pod) (rate(container_fs_reads_bytes_total{node="<node>",pod!=""}[1m]))) |
| Restarts in the window | increase(kube_pod_container_status_restarts_total[30m]) > 0 |
| Why a container last died | kube_pod_container_status_last_terminated_reason == 1 |
Completed). The other apiservers then see an in-flight spike.id="/kubepods.slice") against node memory. Masters that
host more singleton operators carry more memory than their peers.node_cpu_seconds_total by mode.rate()
queries for that node can return nothing during the worst minutes. Use node-exporter metrics there.load_snapshot.py: find, download, extract, repair and serve a run's snapshot.promql.py: range/instant PromQL queries printed as tables.walfix/main.go (with walfix/go.mod and tests in walfix/main_test.go): the WAL repair tool,
standard library only. load_snapshot.py runs it with go run when Go is installed,
otherwise in a golang container. To run it by hand: go run . <raw-wal-dir> <output-wal-dir>.BUILD_ID=<build_id> REPLICA=<replica> # substitute the real values
podman rm -f "prow-prom-${BUILD_ID}-${REPLICA}"
rm -rf -- "$HOME/.cache/prow-prometheus/${BUILD_ID}"
ci:prow-job-analysis — overall failure debugging and the artifact layout (references/artifacts.md).disruption:investigate-disruption — disruption intervals, audit logs and CPU metrics across runs, and regression investigations.bigquery-ci-data:autodl — per-run summaries (CPU timeline, audit latency) to pick runs and windows.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub openshift-eng/ai-helpers --plugin ci36 skills in this plugin
/add-jira-triage-linkAdd a Component Readiness triage record link to a JIRA issue description/bulk-triage-regressionsUse this skill for Component Readiness triage duty - holistically analyze and triage all untriaged regressions for a set of components in a view, clustering them into root-cause buckets/detect-permafailAnalyze consecutive job failures to determine if they represent a permafail pattern versus flaky failuresOther plugins' skills for the same job