Skip to content

fix(monitoring): make the SLO rules of a variable service dashboard work #7977

Description

@dan-petty

Problem

The service dashboard template (#4743) draws the burn rate and the error budget charts from Prometheus recording rules. For a spec with variables, burn_rate_rules returns the rules with the text $namespace and $workload, which Prometheus does not fill in. The two charts also query one record, so they do not follow the selected namespace and workload.

Measured on the dan-petty/homelab cluster on 2026-11-30: the request selector of such a rule matches 0 series, and the same selector with devops and roadmap-service matches 1. Thus the generator output of v0.265.4 gives empty charts, and homelab cannot commit it (dan-petty/homelab#713).

Proposed change

For a spec with variables, record the requests and the failed requests of each window, summed by the labels that the variable matchers name, with only the other matchers. Each chart computes its ratio from the records with the variable matchers. A spec with no variables keeps its rules.

A spec with variables and with good_events is refused, because the template cannot sum its expressions by label.

Owner decision (2026-11-30): keep both charts on recording rules that the selectable dashboard can filter.

Acceptance criteria

  • No rule of a spec holds a Grafana variable.
  • A promtool test shows that the burn rate and the budget of a selected service come from the rules, for a spec with variables.
  • Each chart query of a spec with variables names $namespace and $workload and no fixed window.
  • A spec with variables and good_events fails with a message that names both.
  • The rules and the dashboard of a spec with no variables do not change.

Existing tool considered

Prometheus recording rules and promtool test rules, in use. Sloth (#7504) writes rules per service and has no form for a variable dashboard. No new dependency.

Related

#4743, #7504, dan-petty/homelab#713.

Source

Source: https://github.com/dan-petty/homelab/issues/713

Activity

  1. added
    type/bug
    source/agent
    status/new
    effort/medium
    value/high
    on Nov 30, 2026
  2. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor
  3. added
    scope/monitoring
    priority/p1-high
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 30, 2026
  4. removed
    status/in-progress
    owner/agent
    on Dec 1, 2026
  5. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Live since 2026-12-01 02:48 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p1-highscope/monitoringsource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions