Loading...
Loading...
Query and interact with Prometheus HTTP API for monitoring data. Use when Claude needs to query Prometheus metrics, execute PromQL queries, retrieve targets/alerts/rules status, access metadata about series/labels, manage TSDB operations, or troubleshoot monitoring infrastructure. Supports instant queries, range queries, metadata endpoints, admin APIs, and alerting information.
npx skill4agent add julianobarbosa/claude-code-skills prometheus-api/api/v1curl 'http://<prometheus>:9090/api/v1/query?query=<promql>&time=<timestamp>'curl 'http://<prometheus>:9090/api/v1/query_range?query=<promql>&start=<ts>&end=<ts>&step=<duration>'{
"status": "success" | "error",
"data": <result>,
"errorType": "<string>",
"error": "<string>",
"warnings": ["<string>"]
}400422503| Endpoint | Purpose | Key Parameters |
|---|---|---|
| Instant query | |
| Range query | |
| Format PromQL | |
| Find series by labels | |
| List label names | |
| Label values | |
| Query exemplars | |
| Endpoint | Purpose |
|---|---|
| Target discovery status ( |
| Metric metadata from targets |
| All metric metadata |
| Alerting/recording rules |
| Active alerts |
| Alertmanager discovery |
| Current config YAML |
| CLI flags |
| Runtime info |
| Build info |
| TSDB cardinality stats |
| WAL replay progress |
--web.enable-admin-api| Endpoint | Method | Purpose |
|---|---|---|
| POST | Create TSDB snapshot |
| POST | Delete series ( |
| POST | Clean deleted data |
# Rate of counter over 5m
rate(http_requests_total[5m])
# Sum by label
sum by (job) (rate(http_requests_total[5m]))
# Percentile from histogram
histogram_quantile(0.95, rate(http_request_duration_seconds_bucket[5m]))
# Filter by label
up{job="prometheus", instance=~".*:9090"}
# Increase over time
increase(http_requests_total[1h])
# Average over time range
avg_over_time(process_cpu_seconds_total[5m])[{"metric": {...}, "value": [timestamp, "value"]}][{"metric": {...}, "values": [[ts, "val"], ...]}][timestamp, "value"][timestamp, "string"]scripts/prom_query.py# Instant query
python scripts/prom_query.py http://localhost:9090 'up'
# Range query
python scripts/prom_query.py http://localhost:9090 'rate(http_requests_total[5m])' \
--start '2024-01-01T00:00:00Z' --end '2024-01-01T01:00:00Z' --step '1m'
# Output: table, json, csv
python scripts/prom_query.py http://localhost:9090 'up' --format tablescripts/prom_health.pypython scripts/prom_health.py http://localhost:9090