Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

prow-job-prometheus

БесплатноЗапускает вложенные скриптыНе проверен

Use when you need in-cluster Prometheus metrics from a Prow CI job run — apiserver in-flight requests, etcd disk latency, node CPU/memory/disk, per-pod usage…

openshift-engот openshift-eng★ 123 звезды на GitHub

Об этом скилле

Prow Job Prometheus

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:

  • Autodl or Sippy data points at a time window (high CPU, disruption, a burst of failures) and you need the underlying metrics.
  • Debugging apiserver slowness, etcd latency, node resource exhaustion, or restarts in one run.
  • Comparing the same metrics between a bad run and a good run.

These TSDB's can be quite large, so avoid bulk downloading when possible, this is for targeted investigations.

Prerequisites

  • podman, to run Prometheus (and to build 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.
  • Python 3.9+.
  • Roughly 2 GB of disk per replica (download plus extracted data).
  • Artifacts come from the public 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.

Where the snapshots are

<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.

Step 1: Load the snapshot

SKILL_DIR="${CLAUDE_PLUGIN_ROOT}/skills/prow-job-prometheus"
python3 "$SKILL_DIR/load_snapshot.py" "<prow-job-url>"

The script:

  1. Finds the step with a gather-extra snapshot (pass --step if several steps have one).
  2. Downloads the replica 0 snapshot (--replica 1 for the other replica) into ~/.cache/prow-prometheus/<build_id>/.
  3. Extracts it safely and repairs the WAL with walfix (see below).
  4. Starts quay.io/prometheus/prometheus in podman on the first free port from 9090, waits until ready.
  5. Prints the URL, the data time range, and how many series loaded compared with the live server.

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.

Step 2: Find the time window

Metrics timestamps are UTC. Anchor the window on something concrete from the run:

  • Test failure times from junit (start_time/end_time) or the run's intervals files.
  • The autodl node_cpu_usage_timeline for the run, whose first sample is about the start of e2e.
  • A scrape gap: up == 0 or a missing sample means the target stopped responding.

Step 3: Query

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.

PromQL cookbook

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
Полный SKILL.md на GitHub

Установить prow-job-prometheus в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

load_snapshot.pypromql.pytest_prow_job_prometheus.pywalfix/go.modwalfix/main.gowalfix/main_test.go

FAQ

Что делает скилл prow-job-prometheus?

Use when you need in-cluster Prometheus metrics from a Prow CI job run — apiserver in-flight requests, etcd disk latency, node CPU/memory/disk, per-pod usage, restarts — by downloading the run's Prometheus snapshot, repairing it, and querying it locally with PromQL

Как установить скилл prow-job-prometheus?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл prow-job-prometheus запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить prow-job-prometheus с