Repository navigation
Description
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.
ServiceSpecofsrc/devops_cli/grafana/service_dashboard.pytakes 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 ofk8s/monitoring/dashboards/services.tomlname 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_totalandlitellm_proxy_total_requests_metric_total, and SLI 4 fromlitellm_request_total_latency_metric_bucketwithle="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 dashboardsbuilds 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.pyform). - Each tier 2 service has a Sloth spec whose
serviceis 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
Source: #5445
Alternatives check of 2026-11-23: 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-23, maintained.
Reason: Searches returned no usable results, but the repository facts confirm the already-used Grafana Foundation SDK renders the dashboards; it covers panel and query building only, while the SLO spec, good/valid event fields and per-service SLI tables stay project code.
Covers:
- Renders the dashboard JSON that the service template builds
- Panel and query builders for SLI, budget and burn-rate panels
- Grafana-native output for the make dashboards step
Lacks:
- SLO objective and window; the Sloth spec supplies them
- Optional good_events and valid_events for non-ingress services
- An SLI and SLO for each tier 2 service
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 service dashboard. The LLM gateway and runner Jobs have SLOs and no dashboard. The tier 2 services have no SLI and no SLO in the current monitoring. ServiceSpec reads only Traefik request metrics, so it cannot chart the gateway and Job metrics. This change generalizes the template to good and valid events, adds dashboards for the gateway and runner Jobs, and gives each tier 2 service a Sloth SLO and a dashboard.
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 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 built dashboard has the same Traefik request, error and latency queries as before the change.
Requirement: Gateway SLI 3
The LLM gateway table MUST build a dashboard whose SLI 3 uses litellm_proxy_failed_requests_metric_total and litellm_proxy_total_requests_metric_total.
Scenario: Gateway failed-request SLI
- WHEN make dashboards runs on k8s/monitoring/dashboards/services.toml
- THEN It writes the gateway dashboard with SLI 3 from the two proxy counters and uv run pytest tests/grafana/test_service_dashboard.py passes.
Requirement: Gateway SLI 4
The LLM gateway table MUST build a dashboard whose SLI 4 uses the le="60.0" bucket of litellm_request_total_latency_metric_bucket.
Scenario: Gateway latency SLI
- WHEN make dashboards runs on k8s/monitoring/dashboards/services.toml
- THEN It writes the gateway dashboard with SLI 4 from the 60 s latency bucket and uv run pytest tests/grafana/test_service_dashboard.py passes.
Requirement: Runner Job duration SLI
The runner Jobs table MUST build a dashboard whose SLI is the share of Jobs with job_name=~"devops-cli-runner-.*" that end in under 3,600 s.
Scenario: Runner Job dashboard
- WHEN make dashboards runs on k8s/monitoring/dashboards/services.toml
- THEN It writes the runner Jobs dashboard with the 3,600 s Job duration SLI and uv run pytest tests/grafana/test_service_dashboard.py passes.
Requirement: Tier 2 service tables
services.toml MUST have one service table for each tier 2 service: Valkey, the MCP server, Argo Workflows, Argo CD and Qdrant.
Scenario: Tier 2 dashboards build
- WHEN make dashboards runs on k8s/monitoring/dashboards/services.toml
- THEN It writes one dashboard JSON for each tier 2 service and uv run pytest tests/grafana/test_service_dashboard.py passes.
Requirement: Tier 2 Sloth service names
Each tier 2 service MUST have a Sloth spec whose service equals its k8s/catalog.toml name.
Scenario: Sloth service names match the catalog
- WHEN uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py runs
- THEN It reports no tier 2 service whose Sloth service differs from its catalog name and no tier 2 service without a Sloth entry.
Requirement: New SLI series
Each new SLI MUST select only series that a scrape in k8s/ serves.
Scenario: New SLIs use scraped series
- WHEN uv run pytest tests/prometheus/test_k8s_monitoring_alerting.py runs
- THEN It reports no SLI query that selects a series with no scrape in k8s/.
Requirement: SLO source
A service table MUST read its SLO objective and window from the Sloth spec of #4709 and MUST NOT set slo_target or slo_window_days.
Scenario: SLO values come from Sloth
- WHEN uv run pytest tests/grafana/test_service_dashboard.py runs on a table that names a Sloth service
- THEN The built dashboard uses the objective and window from the Sloth spec and the test rejects a table that also sets slo_target or slo_window_days.
Requirement: Dashboard test suite
The dashboard test suite MUST pass for each new service table.
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 uses the SDK only to render panels. It adds the Sloth SLO source read, the good_events and valid_events fields and the per-service tables in devops_cli.grafana.service_dashboard and services.toml.
Key questions
- How should ServiceSpec accept non-Traefik good and valid events?: Add optional good_events and valid_events PromQL expressions to ServiceSpec. 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_dashboard.py, k8s/monitoring/dashboards/services.toml, 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 a service table get its SLO objective and window?: From the Sloth spec of feat(monitoring): define the Service SLOs in a Sloth spec #4709. The table names the Sloth service and does not set slo_target or slo_window_days. ServiceSpec reads both values from the Sloth spec, and a test rejects a table that sets them. (best practice) [sources: k8s/monitoring/dashboards/services.toml, src/devops_cli/grafana/service_dashboard.py]
- Chosen: Read the Sloth spec. The reply 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.
- How should the gateway and runner Jobs tables express their SLIs?: Use good_events and valid_events in each table. For the gateway, SLI 3 uses the failed and total litellm proxy counters, and SLI 4 uses the le=60.0 latency bucket over all latency buckets. For the runner Jobs, the good events are Jobs with duration under 3,600 s and the valid events are all Jobs with job_name=~devops-cli-runner-.*. (best practice) [sources: src/devops_cli/grafana/service_dashboard.py, tests/prometheus/test_k8s_monitoring_alerting.py]
- Chosen: Use good and valid event expressions in each table. It matches the new fields and lets each non-ingress service use its own counters.
- Rejected: Hard-code the litellm and Job queries in the template. It mixes one service's metrics into the shared template.
- Rejected: Use the Traefik request counter for both services. The gateway and the Jobs are not behind the ingress.
- How should each tier 2 service get an SLI and an SLO?: Use the service-specific Prometheus series that the existing scrape in k8s/ serves. Where the scrape serves only up, use up{job=...} as the availability SLI. Each table names its good and valid events, and the Sloth spec of feat(monitoring): define the Service SLOs in a Sloth spec #4709 gives the objective and window. (best practice) [sources: k8s/monitoring/dashboards/services.toml, tests/prometheus/test_k8s_monitoring_alerting.py]
- Chosen: Use the service-specific series or the up fallback. It uses series that Prometheus already holds and keeps the SLI testable.
- Rejected: Use only the Traefik requests. The tier 2 services are not all behind the ingress.
- Rejected: Add a new metrics exporter for each tier 2 service. It adds cost outside this issue and duplicates scrapes.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both items define SLOs for services, but #4709 creates Sloth YAML specs and this candidate adds Grafana dashboards and extends services.toml to accept non-Traefik metrics.dan-petty commentedon Nov 13, 2026
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 ofk8s/monitoring/dashboards/services.tomlreads them from that spec and keeps noslo_targetorslo_window_dayscopy. 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.mdtok8s/catalog.toml, and the catalog holds no SLO id. So the criterion "Table 2 ofdocs/SRE.mdnames the SLO of each tier 2 service" changes: each tier 2 service has a Sloth spec whoseserviceequals its catalog name, and the generated catalog (#5535) shows the SLO of each service.devops-cli-service commentedon Nov 17, 2026
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_dashboardtemplate 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 giveservices.tomlgood/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)
Covers:
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 18, 2026
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.