A new service needs a dashboard, candidate SLOs, and an error-budget policy — and in most orgs it gets a hand-cloned dashboard with dead panels and no SLO at all.
Tier: Core · Hands-on time: ~60 minutes
This playbook uses AI to draft both artifacts as code from the service's actual metadata (its OTel semantic conventions, metric inventory, and service spec): dashboard JSON/Jsonnet reviewed like any PR, and SLO definitions in OpenSLO/Sloth format that a human workshop then validates. Two AI drafting passes, two different gates — dashboards are verified against live data; SLOs are verified against user expectations, which no model can know.
Skip AI for the one bespoke executive dashboard your org already polishes by hand — generation shines on the long tail of per-service operational dashboards, not the flagship.
/metrics or your Prometheus), OTel semconv compliance status (pb-26 makes this true), plus service tier, dependencies, and traffic pattern.Feed real metadata, demand structure. Paste the metric inventory and service context:
Service: checkout-api (tier 1, HTTP+gRPC, deps: payments, inventory, redis).
Metrics: <pasted inventory with types and labels>.
Generate a Grafana dashboard as JSON with rows: (1) RED overview (rate,
errors, duration p50/p95/p99), (2) dependency health, (3) saturation
(runtime + container), (4) rollout markers via deploy annotations.
Rules: use ONLY metrics from the inventory — if a standard panel's metric
is missing, emit a placeholder panel titled "MISSING: <what to instrument>"
instead of inventing a metric name. Template variables for cluster and
namespace. Every panel gets a description stating what "bad" looks like.
The MISSING-panel rule turns hallucination pressure into an instrumentation gap report — the most useful side effect of this workflow.
Review as code, then against live data. Diff the JSON in a PR like any change. Then import to a test folder and check every panel against reality: does it render data, do the numbers match a hand-run query (pb-22's known-answer check), do template variables actually filter? Dead panels and averaged-percentile panels are the classic generated defects.
Draft candidate SLOs from the same context.
From this service context and metric inventory, propose 2-3 SLIs with:
- SLI definition as a PromQL ratio (good events / valid events), metrics
from the inventory only.
- Three candidate targets (conservative/moderate/aggressive) with the
rationale and the implied monthly error budget in minutes/requests.
- What user experience each SLI does and does NOT capture.
- An error-budget policy draft: thresholds at which we page, freeze
features, or escalate — as a table.
Output as an OpenSLO/Sloth YAML spec plus a one-page discussion doc.
Workshop the SLOs — the human gate AI cannot replace. Targets are commitments about user happiness and engineering priorities. In a 45-minute session with the service team: check each SLI ratio against known incidents ("would this SLO have caught the March outage?" — replay historically with the actual PromQL), pick targets against real user expectations and current baseline performance (an SLO you're already violating is a project plan, not an SLO), and edit the budget policy until the team would actually honor the freeze clause.
Ship both through the pipeline. Dashboard JSON/Jsonnet merged to the dashboards repo with provisioning; Sloth spec compiled to Prometheus recording/alerting rules (sloth generate) and merged. Both artifacts now regenerate reviewably when metadata changes — that is the "as code" payoff.
The model can propose an SLI ratio; it cannot know that your users tolerate 2s checkout latency but abandon at 3s. Dashboards are verified against data; SLO targets are verified against humans.
Never auto-provision generated dashboards or SLO rules to production on merge without the data checks — a fleet-wide deploy of a subtly wrong Jsonnet template is a fleet-wide lie told 40 times.