slo-manage

Create, update, sync, and delete Grafana SLO definitions using gcx CLI commands.

1|Updated May 25, 2020
One-click install
npx skills add https://github.com/titaneric/dotfiles --skill slo-manage-titaneric
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: slo-manage
Source: https://github.com/titaneric/dotfiles/tree/main/dot_agents/skills/slo-manage
Command: npx skills add https://github.com/titaneric/dotfiles --skill slo-manage-titaneric

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing Grafana SLO definitions manually through APIs or the UI is error-prone and hard to version-control. This Skill provides structured workflows for creating, updating, pulling, pushing, and deleting SLO definitions via the gcx CLI with built-in dry-run validation. ## Core Features & Use Cases - SLO Lifecycle Management: Create new SLOs from ratio, freeform, or threshold query templates, update existing definitions by UUID, and delete SLOs after confirmation. - GitOps Sync: Pull all SLO definitions to local YAML files and push directories of definitions back, enabling version-controlled SLO management. - Query Type Guidance: Decision tables map user intent and metric suffixes (_total, _bucket, _gauge) to the correct query type, with guardrails enforcing $__rate_interval in freeform PromQL. - Use Case: A platform engineer wants to define a 99.9% availability SLO for an HTTP API. The Skill resolves the Prometheus datasource UID, builds a ratio-query YAML, validates it with a dry-run push, and confirms the created SLO's UUID. ## Quick Start Ask the assistant to create a new SLO with a 99.9% objective over 28 days for your service's HTTP success rate using the gcx CLI.

Frequently Asked Questions about slo-manage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Grafana SLO from the command line?

Build a YAML definition using apiVersion slo.ext.grafana.app/v1alpha1 with kind SLO, then run gcx slo definitions push slo.yaml --dry-run followed by the actual push. Leave metadata.name empty so the server assigns a UUID on creation.

How do I choose between ratio, threshold, and freeform SLO query types?

Use ratio for success/total rates like HTTP success percentage, threshold for metrics compared against a fixed value like up >= 1, and freeform only as a last resort for raw PromQL. Metric suffixes guide the choice: _total counters map to ratio, _bucket histograms and gauges map to threshold.

Why does the SLO API reject my freeform PromQL query?

Freeform queries must use $__rate_interval in all rate() and increase() calls. Literal range durations like [5m] are rejected by the SLO API, so replace them with the $__rate_interval macro.

How do I sync SLO definitions with Git using GitOps?

Run gcx slo definitions pull -d ./slos to write all SLOs to ./slos/SLO/<uuid>.yaml files for version control. To apply changes, push the directory with gcx slo definitions push ./slos/SLO/*.yaml after a dry-run.

How do I update an existing SLO without creating a duplicate?

Fetch the current definition with gcx slo definitions get <UUID> -o yaml, edit the fields you need, and push it back. Keeping the UUID in metadata.name makes the push an upsert that updates the existing SLO instead of creating a new one.

What should I do when an SLO push fails with a 400 or 404 error?

A 400 error means the YAML structure is invalid or the destinationDatasource.uid is wrong, so compare against the template and verify the UID with gcx datasources list. A 404 on update means the UUID was not found; confirm it with gcx slo definitions list.