grafana/gcx/slo-investigate
Claude Code and agent skill by grafana/gcx
- community
Checking that the SKILL.md file is still in the repository.
Diagnoses a breaching Grafana SLO via gcx: root cause, dimensional breakdown, alert rule correlation, runbooks. Use when an SLO is breaching or burning its error budget. For a status overview use slo-check-status. For tuning use slo-optimize.
Install
npx vskill@latest install grafana/gcx/slo-investigateSKILL.md
The same SKILL.md was published earlier as grafana/gcx/slo-investigate.
SLO Investigator
Deep-dive investigation of breaching SLOs: dimensional breakdown, alert correlation, runbook access. For experienced operators — no hand-holding.
Core Principles
- Use gcx commands — do not call Grafana APIs directly (no curl, no HTTP libraries)
- Trust the user's expertise — skip obvious context, get to the root cause
- Use
-o jsonfor agent processing, default format for user display; show graphs for time-series data - Errors collected at the end — do not interleave error handling in workflow steps
- Use
--from/--tofor all time-range commands (never--start/--end)
Investigation Workflow
Step 1: Retrieve SLO Definition
Extract from the JSON response:
.metadata.name— SLO name.spec.query.type— query type:ratio,freeform, orthreshold- For ratio:
.spec.query.ratio.successMetric,.spec.query.ratio.totalMetric,.spec.query.ratio.groupByLabels[] - For freeform:
.spec.query.freeform.query .spec.objectives[0].value— objective (0–1),.spec.objectives[0].window— window.spec.destinationDatasource.uid— Prometheus datasource UID.spec.alerting.fastBurn.annotations,.spec.alerting.slowBurn.annotations— runbook/dashboard URLs.metadata.annotations— additional runbook/dashboard references
If no UUID is given, list SLOs and ask which to investigate:
Step 2: Check Status with Wide Output
This shows SLI, ERROR_BUDGET, BURN_RATE, SLI_1H, SLI_1D, and STATUS.
Early exit — OK status: If STATUS is OK, report health metrics and stop:
Early exit — NODATA status: If STATUS is NODATA, branch to NODATA diagnosis:
When diagnosing NODATA, two environment realities save wasted queries: on remote-write stacks there are no scrape targets, so up-based scrape-health checks return nothing — absence of up series is not evidence of a problem. And if datasources list --type prometheus returns an empty list, the stack may leave type blank in list payloads (known issue) — rerun without --type or use the UID from .spec.destinationDatasource.uid directly.
Lifecycle states: If status is Creating/Updating/Deleting/Error, report that the SLO is in a transient state and investigate the Grafana backend.
Step 3: Render Timeline
For wider trends:
Show the graph output (default). Use it to identify when breaching started and how severe it is.
Step 4: Dimensional Breakdown
Resolve the datasource UID. If .spec.destinationDatasource.uid is set, use it. Otherwise auto-discover:
For ratio queries — extract success/total metric selectors and groupByLabels, then query dimensional breakdown:
If groupByLabels is empty, try common dimensions: cluster, namespace, service, status_code, endpoint.
For freeform queries — use the raw PromQL expression and add by (<label>) grouping:
Use graph output to display dimensional trends visually. Use -o json to extract exact values for the report.
To query the SLO's own recording rule metrics instead (grafana_slo_sli_window, burn rate, error budget expressions), see references/slo-promql-patterns.md for the metric inventory and ready-made PromQL patterns.
Step 5: Search for Related Alert Rules
Also try searching by UUID fragment if the name-based search returns no results:
Extract for each matching rule: name, state (firing/pending/inactive), labels, and annotations.
Step 6: Extract Runbook and Dashboard URLs
Collect URLs from:
.spec.alerting.fastBurn.annotations.runbook_url.spec.alerting.fastBurn.annotations.dashboard_url.spec.alerting.slowBurn.annotations.runbook_url.spec.alerting.slowBurn.annotations.dashboard_url.metadata.annotations.*
If a GitHub URL is found in runbook annotations and gh is available:
For raw GitHub URLs (raw.githubusercontent.com), extract the content URL pattern and use gh api with the equivalent API endpoint.
Output Format
After completing the investigation, present results in this structure:
Error Handling
- gcx slo definitions get fails with 404: SLO UUID not found. Run
gcx slo definitions listand confirm the UUID. - gcx slo definitions status returns empty: No status available — SLO may be newly created. Check if recording rules are running (STATUS may show NODATA).
- gcx metrics query fails with datasource error: Datasource UID may be wrong. Run
gcx datasources list --type prometheusto find the correct UID. If that list is empty (blanktypefields in the payload), rerun without--typeand select by name. - gcx metrics query returns no data: The SLO metrics may write to a separate datasource (check
.spec.destinationDatasource.uid). Try both the destination datasource and the default Prometheus datasource. - alert rules list returns empty: Alert rules may be in a different folder. Try without filters:
gcx alert rules list -o json | jq lengthto confirm total count. - gh api fails: If
ghis not authenticated or unavailable, report the runbook URL directly and skip content fetching. - SLO has no groupByLabels (ratio query): Try common breakdown dimensions:
cluster,namespace,service,endpoint,status_code. Report which ones return data. - Multiple SLOs with similar names: When searching alert rules by name pattern, report all matches and their states — don't silently drop duplicates.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclaude-plugin/skills/slo-investigate/SKILL.md
Popularity
- Repository stars
- 531
- Repository forks
- 42
- 7-day trend score
- 31
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/grafana/gcx/slo-investigate)