Loading...
Loading...
Execute PromQL instant and range queries against Oodle metrics using the Prometheus-compatible query API.
npx skill4agent add oodle-ai/agent-skills oodle-metrics-querybrew install oodle-ai/oodle/oodle
oodle configureoodle metrics query --query "up" -o json | jq '.status'oodle metrics names --start -1h --end nowoodle metrics labels <name> --start -1h --end now| Task | Command |
|---|---|
| Instant PromQL query | |
| Instant query at specific time | |
| Range PromQL query | |
| Range query with partial response | |
# CORRECT — instant query with JSON output for scripting
oodle metrics query --query "sum(up)" -o json
# CORRECT — instant query at a specific time
oodle metrics query --query "up{job=\"prometheus\"}" --time 1700000000 -o json
# CORRECT — use relative time
oodle metrics query --query "up" --time -5m -o json
# WRONG — omitting --query flag
oodle metrics query -o json--query--start--end--step# CORRECT — range query over the last hour with 60-second resolution
oodle metrics query-range --query "rate(http_requests_total[5m])" --start -1h --end now --step 60s -o json
# CORRECT — range query with absolute timestamps
oodle metrics query-range --query "up" --start 1700000000 --end 1700003600 --step 60s -o json
# CORRECT — enable partial response for degraded-mode queries
oodle metrics query-range --query "up" --start -1h --end now --step 60s --partial-response -o json
# WRONG — missing --step flag
oodle metrics query-range --query "up" --start -1h --end now -o json
# WRONG — missing --start or --end
oodle metrics query-range --query "up" --step 60s -o jsonoodle metrics# CORRECT — discover first, then query
oodle metrics names --start -1h --end now -o json | jq '.[] | select(startswith("http"))'
oodle metrics labels http_requests_total --start -1h --end now
oodle metrics query --query "sum(rate(http_requests_total[5m]))" -o json
# WRONG — guessing metric names
oodle metrics query --query "sum(rate(requests_total[5m]))" -o json# CORRECT — 60s step for a 1-hour window (60 data points)
oodle metrics query-range --query "up" --start -1h --end now --step 60s -o json
# CORRECT — 5m step for a 24-hour window (288 data points)
oodle metrics query-range --query "up" --start -1d --end now --step 5m -o json
# WRONG — 1s step for a 24-hour window (86400 data points — too many)
oodle metrics query-range --query "up" --start -1d --end now --step 1s -o json| Error | Cause | Fix |
|---|---|---|
| 401 Unauthorized | Invalid or missing API key | Run |
| 400 Bad Request | Invalid PromQL expression | Check syntax at https://prometheus.io/docs/prometheus/latest/querying/basics/ |
| Empty result (not an error) | Metric does not exist or no data in time range | Run |
| connection refused | Wrong | Check |
| 429 Too Many Requests | Rate limited | Add |
| Missing required flag for range query | Add |
| Missing required flag | Add |