grafana/gcx/slo-manage
Claude Code and agent skill by grafana/gcx
- community
Checking that the SKILL.md file is still in the repository.
Creates, updates, pulls, pushes, and deletes Grafana SLO definitions via gcx, with dry-run validation and GitOps sync. For SLO health use slo-check-status. For a breaching SLO use slo-investigate.
Install
npx vskill@latest install grafana/gcx/slo-manageSKILL.md
The same SKILL.md was published earlier as grafana/gcx/slo-manage.
SLO Management
Create, update, sync, and delete SLO definitions using gcx.
Core Principles
- Use gcx commands exclusively — do not call Grafana APIs directly
- Always run
--dry-runbefore any push operation; proceed only if dry-run succeeds - Trust the user's expertise — skip explanations of SLO concepts
- Use
-o jsonfor agent processing; default table/yaml for user display - Auto-resolve datasource UIDs; only ask if auto-discovery fails
Query Type Decision Table
Select query type based on what the user describes:
| User describes | Query type | |
|---|---|---|
| "percentage of successful requests", "success rate", "error rate" | ratio | |
| "raw PromQL expression", "custom metric formula" | freeform | |
| "metric above/below threshold", "latency under X ms", "availability percentage" | threshold |
Metric-Pattern Decision Table
Use the metric name suffix to pick the query type when the user provides a metric name:
| Metric suffix / type | Query type | Rationale | |
|---|---|---|---|
_total counter | ratio | success_total / all_total | |
_bucket histogram | threshold | use le-bound threshold on quantile | |
_gauge or up metric | threshold | compare to fixed threshold | |
| None of the above | freeform | last resort only |
Guardrail: Freeform is a last resort. Before choosing freeform, verify the SLI cannot be expressed as ratio or threshold.
Hard requirement: Freeform queries MUST use $__rate_interval in all rate()/increase() calls. Literal ranges like [5m] are rejected by the SLO API.
Workflow 1: Create New SLO
Step 1: Determine query type using the decision table above
Step 2: Resolve destination datasource UID
Use the UID from the output. Some stacks do not populate type in the list response, so the filter can come back empty even though Prometheus datasources exist — in that case list everything and pick the canonical Grafana Cloud Prometheus entry (name like grafanacloud-<stack>-prom):
If that leaves zero or multiple plausible Prometheus candidates, ask the user which UID to use rather than guessing (the stack's default: true datasource is not necessarily Prometheus).
Step 3: Build YAML from the appropriate template
For complete ratio, freeform, and threshold templates (including alerting, labels, and folder fields), see references/slo-templates.md. Key structure:
Step 4: Preview with dry-run, then push
Push semantics:
metadata.nameset to UUID → update if it exists; otherwise match by the SLO name before creating.- Empty
metadata.name→ match by the SLO name before creating; the server assigns a UUID only when creating. - A dry-run against an adapter without server validation is reported as unverified and sends no writes; it does not establish that the backend accepts the manifest.
Run gcx slo definitions list to confirm.
Workflow 2: Update Existing SLO
Step 1: Get current definition
Step 2: Modify the YAML file
Edit the relevant fields (objective value, query, alerting, etc.). Do not modify metadata.name (UUID) or readOnly fields.
Step 3: Dry-run, then push
Workflow 3: GitOps Sync (Pull/Push)
Pull all SLOs to disk
Push directory of SLOs
Workflow 4: Delete SLO
Step 1: Confirm SLO identity
Confirm the UUID and name with the user before deletion.
Step 2: Delete
Use --force to skip the confirmation prompt when running in agent mode (there is no -f shorthand on delete).
Configuration Guidance
Objective values (stored as 0–1, displayed as percentage):
- Typical range: 0.9 (90%) to 0.9999 (99.99%)
- Common starting points: 0.99 (99%), 0.999 (99.9%), 0.9999 (99.99%)
Window options: 7d, 14d, 28d, 30d
- 28d is most common; matches many SLO frameworks
- Shorter windows (7d) react faster but have higher variance
Alerting best practices:
fastBurn: Pages on-call (high burn rate, short window — catches rapid budget consumption)slowBurn: Creates tickets (low burn rate, long window — catches gradual degradation)
Labels: Use consistent label keys (team, service, environment, tier) for filtering and grouping.
GroupByLabels (ratio/threshold queries): Add labels like cluster, service, endpoint for dimensional breakdown in status and investigation.
Output Format
After create/update:
After pull:
After delete:
Error Handling
- Push fails with 400: Check YAML structure matches template; verify
destinationDatasource.uidis valid - Push fails with 404 on update: UUID in
metadata.namenot found; check withgcx slo definitions list - Pull creates empty directory: No SLOs in this context; check
gcx config viewfor active context - `--type prometheus` filter returns empty: the list API may not populate
typeon this stack; rungcx datasources listwithout the filter and match the Cloud Prometheus name pattern before concluding none exist - Dry-run shows unexpected diff: Show diff to user and ask for confirmation before proceeding
- Delete fails with 404: UUID already deleted or wrong UUID; verify with
gcx slo definitions list
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-manage/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-manage)