Skip to content

feat(monitoring): give each tier 1 and 2 service an SLO and a dashboard #5475

Done

Description

@dan-petty

Update 2026-11-26 (infra move): the service tables go to dan-petty/homelab.

This issue keeps the code of ServiceSpec (src/devops_cli/grafana/service_specs.py): good and valid event fields, the objective from the Sloth spec, tests, and specs under k8s/devops/monitoring/slos/. services.toml, catalog.toml and the generated dashboards are in homelab. docs/SRE.md is gone: the comment of 2026-11-13 replaces its Table 2 criterion with one Sloth spec for each tier 2 service.

Follow-up: dan-petty/homelab#301.


Problem or Motivation

The SRE service spec (docs/SRE.md, #5445) gives each tier 1 and tier 2 service an SLI and an SLO. On 2026-11-13, only the roadmap Service has a service dashboard from the template (devops-roadmap-service and devops-sre-service).

  • The LLM gateway (SLO 3 and SLO 4) and the runner Jobs (SLO 2) have no dashboard. The owner set these SLOs on 2026-11-11 (feat(monitoring): define the Service SLOs in a Sloth spec #4709).
  • The tier 2 services Valkey, the MCP server, Argo Workflows, Argo CD and Qdrant have no SLI and no SLO.
  • ServiceSpec of src/devops_cli/grafana/service_dashboard.py takes the requests of a service only from the Traefik metrics of the ingress. The gateway and the Jobs are not behind the ingress.

Proposed Solution

  • Let a [[service]] table of k8s/monitoring/dashboards/services.toml name its good events and its valid events, not only the Traefik requests.
  • Add a table for the LLM gateway: SLI 3 from litellm_proxy_failed_requests_metric_total and litellm_proxy_total_requests_metric_total, and SLI 4 from litellm_request_total_latency_metric_bucket with le="60.0".
  • Add a table for the runner Jobs (job_name=~"devops-cli-runner-.*"): the share of the Jobs that end in under 3,600 s.
  • For each tier 2 service, choose an SLI from a series that Prometheus already holds, with an objective, and add its table.
  • When the Sloth spec of feat(monitoring): define the Service SLOs in a Sloth spec #4709 merges, use its window and its burn-rate lines.

Acceptance Criteria

  • make dashboards builds one dashboard for each new table, and the dashboard tests pass.
  • Each new SLI selects only the series that a scrape in k8s/ serves (tests/prometheus/test_k8s_monitoring_alerting.py form).
  • Each tier 2 service has a Sloth spec whose service is its catalog name (comment of 2026-11-13).

Existing Tool Considered

The template devops_cli.grafana.service_dashboard with the Grafana Foundation SDK already builds the service dashboards. No new tool. Cost: about 0.5 M tokens and 3 hours.

Related

#4709, #3655, #4675.

Source: #5445

Alternatives check of 2026-11-29: in-use.
The item already names this tool.
Tool: grafana/grafana-foundation-sdk (https://github.com/grafana/grafana-foundation-sdk), Apache-2.0, last activity 2026-11-29, maintained.
Reason: The searches returned no dashboard-generation tool page; the tool the issue names, grafana-foundation-sdk, is open, maintained and renders the service dashboards, but it holds no SLO, objective or good/valid event logic, so those fields stay project code.

Covers:

  • Typed dashboard, panel and query builders in Python
  • Prometheus targets with an arbitrary PromQL expression
  • Templating, thresholds and unit settings for panels

Lacks:

  • No SLO objective, window or error-budget model
  • No Sloth spec reading for objective and window
  • No per-service dashboard template or services.toml table
  • No good-event divided by valid-event ratio or burn-rate maths

Proposed design

Problem statement

The SRE service spec gives tier 1 and tier 2 services an SLI and an SLO. Only the roadmap Service has a dashboard. The LLM gateway and runner Jobs have SLOs and no dashboard, and the tier 2 services have no SLI and no SLO. ServiceSpec reads only Traefik request metrics, so it cannot chart the gateway and Job metrics. This change adds optional good and valid event fields and reads the SLO objective and window from the Sloth spec. The environment tables, catalog and generated dashboards are in dan-petty/homelab and are out of this issue.

Acceptance criteria

Requirement: Good and valid event fields

ServiceSpec SHALL accept optional good_events and valid_events PromQL expressions and use them for the SLI and the error ratio.

Scenario: Good and valid events replace Traefik requests

  • WHEN A service table sets good_events and valid_events and uv run pytest tests/grafana/test_service_dashboard.py runs
  • THEN The test asserts that the built dashboard uses the good and valid events in the SLI, budget and burn-rate queries and uses no Traefik request query for that service.

Requirement: Traefik default

A service table that sets neither good_events nor valid_events MUST keep the existing Traefik request, error and latency queries.

Scenario: Existing table keeps its queries

  • WHEN The existing devops-roadmap-service table is loaded and uv run pytest tests/grafana/test_service_dashboard.py runs
  • THEN The test asserts that the built dashboard has the same Traefik request, error and latency queries as before the change.

Requirement: Sloth SLO source

ServiceSpec SHALL accept an optional sloth_spec path and read the SLO objective and window from that Sloth spec.

Scenario: SLO values come from Sloth

  • WHEN A service table sets sloth_spec to a Sloth spec file and uv run pytest tests/grafana/test_service_dashboard.py runs
  • THEN The test asserts that the built dashboard uses the objective and window from the Sloth spec.

Requirement: Duplicate SLO values rejected

A service table that sets sloth_spec MUST NOT also set slo_target or slo_window_days.

Scenario: Duplicate SLO values are rejected

  • WHEN A service table sets sloth_spec and slo_target and uv run pytest tests/grafana/test_service_dashboard.py runs
  • THEN The test asserts that validation fails with an error that names slo_target.

Requirement: Dashboard test suite

The dashboard test suite MUST pass for the new fields and the existing tables.

Scenario: Dashboard tests pass

  • WHEN uv run pytest tests/grafana/test_service_dashboard.py tests/prometheus/test_dashboard_queries.py runs
  • THEN Both test modules pass.

Existing Tool Considered

grafana/grafana-foundation-sdk (verdict: in-use; the item already names this tool). The alternatives check in the issue body gives what the tool covers and lacks. This proposal keeps the SDK for dashboard rendering and adds the ServiceSpec good_events, valid_events and sloth_spec fields in project code, which the SDK lacks. The written cost is about 0.5 M tokens and 3 hours.

Key questions

  • Which repository holds services.toml, catalog.toml and the generated dashboards?: dan-petty/homelab holds them. devops-cli holds no environment tree. The environment tables, catalog and generated dashboards are out of this issue. [sources: CONTEXT.md]
  • How should ServiceSpec accept non-Traefik good and valid events?: Add optional good_events and valid_events fields. When both are set, the SLI and error ratio use 1 minus good events divided by valid events. When neither is set, the existing Traefik requests and errors fields keep their current behavior. (best practice) [sources: src/devops_cli/grafana/service_specs.py, src/devops_cli/grafana/service_dashboard.py, tests/grafana/test_service_dashboard.py]
    • Chosen: Add optional good_events and valid_events fields. It keeps the Traefik defaults and lets the gateway and Job tables name their own series.
    • Rejected: Replace requests and errors with good_events and valid_events. It breaks the existing roadmap Service table and its tests.
    • Rejected: Add a separate spec type for non-ingress services. It duplicates the SLO, budget and panel logic.
  • Where should ServiceSpec get the SLO objective and window?: Add an optional sloth_spec path field. When set, load_specs reads objective and window from the Sloth YAML file. A table that sets sloth_spec and also sets slo_target or slo_window_days fails validation. The Sloth specs under k8s/devops/monitoring/slos/ are the source for the product services. (best practice) [sources: src/devops_cli/grafana/service_specs.py, src/devops_cli/prometheus/slo_rules.py, k8s/devops/monitoring/slos/llm-gateway-requests.yaml, k8s/devops/monitoring/slos/llm-gateway-latency.yaml]
    • Chosen: Read the Sloth spec by path. It makes the Sloth spec the only copy and prevents drift.
    • Rejected: Keep slo_target and slo_window_days in services.toml. It creates a second copy that can drift.
    • Rejected: Read Sloth and keep a copy for comparison. It keeps the copy and the drift risk.
  • Should this issue add the gateway, runner Jobs and tier 2 service tables and dashboards?: No. The service tables, catalog and generated dashboards are in dan-petty/homelab, and homelab#301 follows them. This issue adds the ServiceSpec fields and tests only. The existing product Sloth specs under k8s/devops/monitoring/slos/ stay in this repository. (best practice) [sources: CONTEXT.md, k8s/devops/monitoring/slos/llm-gateway-requests.yaml, src/devops_cli/grafana/service_specs.py]
    • Chosen: Keep the environment tables and dashboards in dan-petty/homelab. devops-cli holds no environment tree, and homelab#301 already tracks that work.
    • Rejected: Add the environment tables and dashboards here. It puts environment data in the product base and breaks the repository boundary.
    • Rejected: Copy the tables and dashboards into both repositories. It creates two copies that can drift.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/feature
    scope/monitoring
    status/new
    value/high
    effort/medium
    on Nov 13, 2026
  3. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 13, 2026
  5. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    Scope from the spec split (2026-11-13)

    The objective and the window of each SLO live only in the Sloth spec of #4709. A [[service]] table of k8s/monitoring/dashboards/services.toml reads them from that spec and keeps no slo_target or slo_window_days copy. If the template cannot read the spec, a test compares the two values.

    The split of the SRE spec (#5538) moves Table 2 of docs/SRE.md to k8s/catalog.toml, and the catalog holds no SLO id. So the criterion "Table 2 of docs/SRE.md names the SLO of each tier 2 service" changes: each tier 2 service has a Sloth spec whose service equals its catalog name, and the generated catalog (#5535) shows the SLO of each service.

  6. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: in-use

    Reason: Grafana Foundation SDK is an open, maintained library that builds Grafana dashboards as code, and the issue itself says the project's devops_cli.grafana.service_dashboard template already builds the service dashboards with it; because it renders panels from any PromQL series, it covers the dashboard side of the need (including the litellm and runner-Job metrics that are not behind the ingress). It does not define SLIs/SLOs, objectives, windows or burn-rate alerts (the Sloth spec of #4709 owns those), and it does not itself give services.toml good/valid events instead of Traefik requests, so it covers only part of the issue.

    The item already names this tool.

    Tool: grafana/grafana-foundation-sdk (https://github.com/grafana/grafana-foundation-sdk)

    • License: Apache-2.0
    • Last activity: 2026-11-17
    • Maintained: yes

    Covers:

    • builds Grafana dashboards as code, one per service table
    • renders panels from any PromQL series, so non-Traefik metrics such as litellm_* and runner Job metrics can be charted
    • the project's devops_cli.grafana.service_dashboard template already builds the service dashboards with it

    Lacks:

    • SLI/SLO definitions: good and valid events, objectives, windows and burn-rate alerts are not part of the SDK
    • reading the window and burn-rate lines of the Sloth spec of feat(monitoring): define the Service SLOs in a Sloth spec #4709
    • the services.toml change that lets a service name its good and valid events instead of Traefik requests
    • choosing an SLI and an SLO for each tier 2 service and recording it in the catalog/SRE table

    Tools considered:

    Searches run:

    • open source tool generate SLO dashboards per service Prometheus, results: 5
    • Sloth Prometheus SLO generator Grafana dashboards, results: 5
    • Grafana Foundation SDK build dashboards as code, results: 5
    • grafana-foundation-sdk github, results: 5
    • slok sloth SLO generator, results: 5
    • pyrra SLO grafana dashboard prometheus rules, results: 5
    • sloth generate prometheus rules SLO spec good total events, results: 5
    • "sloth" SLO generator prometheus, results: 5
    • grafana dashboard as code python library, results: 5

    Sources:

    Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.

  7. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at ed927ec while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  8. added
    status/ready
    and removed
    status/new
    on Nov 27, 2026
  9. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  10. added
    status/in-progress
    and removed
    status/ready
    on Nov 29, 2026
  11. added
    status/in-review
    and removed
    status/in-progress
    on Nov 29, 2026
  12. removed
    status/in-review
    on Nov 29, 2026
  13. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 16:17 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/p2-mediumscope/monitoringsource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions