Skip to content

test(monitoring): find alert rules that read missing series with pint #5011

Open

Description

@dan-petty

Update 2026-11-26 (infra move): the cluster alert rules go to dan-petty/homelab.

This issue keeps pint for the product rules in k8s/devops/monitoring/prometheus-rules-values.yaml. tools.lock is gone: pint must come from the devtools image, which does not have it today. The rules of k8s/monitoring/prometheus-values.yaml are homelab work. The live series run is dan-petty/homelab#363 and pint watch is dan-petty/homelab#364.

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


Problem or Motivation

promtool tests prove that a rule fires on fixtures, not that the live Prometheus has the series that the rule reads. ResearchCriticalFindings is silent today because the research sweep has not run in 7 d (#3908). Other gaps are known (PersistentVolumeSpaceLow on local-path) or planned (the #4566 RAG alert). This item is rank 21 of the cluster integration plan #4989.

Proposed Solution & Architectural Design

  1. Add the offline pint ci checks (cloudflare/pint, Apache-2.0, v0.90.0) to CI for k8s/devops/monitoring/prometheus-rules-values.yaml.
  2. Run the live series checks from a workstation through the Prometheus ingress.
  3. Add a pint watch Deployment only if the live run finds gaps that come back.
  4. A rule that reads an event-only series gets a pint disable comment with the reason.

Target Subsystem

SDLC, Git & PR Governance (CI checks of k8s/monitoring/).

Existing Tool Considered

pint (Apache-2.0). Nothing is built.

Acceptance Criteria

  • The CI pint check passes on main and fails on a rule with a syntax or label error.
  • A comment on this issue lists the live run result: each rule that reads a missing series, and its fix or its disable reason.

Dependencies

None.

Source: #4989

Alternatives check of 2026-11-26: not-applicable.
Class: test, no model call.
Tool: none found.

Proposed design

Problem statement

The product alert rules in k8s/devops/monitoring/prometheus-rules-values.yaml have no offline lint gate for PromQL, labels and annotations. A broken rule reaches main and the live Prometheus only. This change adds a pint row to the devops ci gate, which the Static Analysis check runs, over the product rule groups. The live series run and pint watch are homelab work in dan-petty/homelab#363 and dan-petty/homelab#364.

Acceptance criteria

Requirement: The pint row runs over the product rules

The devops ci gate SHALL hold a pint row that runs pint ci in offline mode over the groups of serverFiles.devops_cli_alerting_rules.yml in k8s/devops/monitoring/prometheus-rules-values.yaml.

Scenario: The pint row runs offline

  • WHEN uv run devops ci --only pint runs with no Prometheus server
  • THEN The row exits 0, writes the product rule groups to a temporary rule file, and its output names the pint version and the rule file.

Requirement: An invalid expression fails the row

The pint row SHALL fail when a product rule holds an expression that is not valid PromQL or a label or annotation template that pint refuses.

Scenario: A broken expression fails the row

  • WHEN a rule under serverFiles.devops_cli_alerting_rules.yml holds an expr that is not valid PromQL
  • THEN uv run devops ci --only pint exits non-zero and its output names the file, the line and the pint check.

Requirement: The row uses the devtools pint

The pint row SHALL run the pint binary from the devtools image.

Scenario: The row uses the image pint

  • WHEN the Static Analysis check runs uv run devops ci --only pint
  • THEN The row runs pint from PATH and its output names the version that pint --version prints.

Requirement: A missing pint fails the row

The pint row MUST fail with a message that names the missing pint binary when the devtools image does not provide it.

Scenario: The image has no pint

  • WHEN uv run devops ci --only pint runs on an image without pint
  • THEN The row exits non-zero and its output names pint and the devtools image.

Existing Tool Considered

The alternatives check of 2026-11-26 in the issue body gave not-applicable for class test and named no tool. The item names pint (Apache-2.0, v0.90.0), an open, maintained rule checker, and the change builds no checker. pint covers offline PromQL, label and annotation checks. It lacks a live Prometheus, so it cannot show that a rule reads a series that the server exports; that live run is dan-petty/homelab#363. The devtools image does not have pint today, so the row waits on that image.

Key questions

  • Which tool checks the product Prometheus rule file?: pint (Apache-2.0, v0.90.0) checks the product rule file offline. The alternatives check gave not-applicable and named no tool. The item names pint. The change builds no checker. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml]
    • Chosen: pint offline. The item names it. It is open and maintained. It checks PromQL, label names and annotation templates with no server.
    • Rejected: promtool check rules. It checks the expression only. It does not check label names or annotation templates.
    • Rejected: a linter that the repository builds. It costs build, keep and fix work for a check that pint already runs.
  • Where does the pint row run?: Add a pint row to the devops ci table. The row runs inside the existing Static Analysis check, because that job runs the gate. The required check names do not change. (best practice) [sources: openspec/specs/ci-gate-rows/spec.md, docs/TESTING.md, .github/workflows/ci.yml, src/devops_cli/commands/ci.py]
    • Chosen: a row of the devops ci gate. The gate spec and docs/TESTING.md require a check of committed files to be a row. The Static Analysis job runs the gate.
    • Rejected: a raw step in the Static Analysis job. A raw step runs in CI only. A local devops ci run and the runner Job would skip it.
    • Rejected: a new workflow job. A new check name needs a ruleset change, which only a person makes.
  • How does the row feed pint the product rules?: The row extracts the groups of serverFiles.devops_cli_alerting_rules.yml to a temporary Prometheus rule file. It runs pint over that file. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml]
    • Chosen: extract the groups to a rule file. The product file is a Helm values file. pint reads a Prometheus rule file, whose top level is groups.
    • Rejected: point pint at the values file. The values file nests the rules under serverFiles. It is not a Prometheus rule file.
    • Rejected: copy the rules to a second file. A second copy drifts from the product file.
  • How is pint available to the row?: Use the pint binary from the devtools image. The container-image spec says the Dockerfile takes its tools from the devtools image. The image lacks pint today, so the row waits on the image. (best practice) [sources: openspec/specs/container-image-layers/spec.md, docs/DEVCONTAINER_USAGE.md]
    • Chosen: the devtools image. The container-image spec says the Dockerfile takes its tools from the devtools image.
    • Rejected: a tools.lock entry. The issue says tools.lock is gone.
    • Rejected: a curl download in the row. It adds a network step and skips the image pin.

Fit

Fits in one pull request.

Suspected block

The devtools image must include pint v0.90.0 before the pint row can pass.

Dependencies

None.

Moved to new items

#6025, #6026

Activity

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

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 12, 2026
  5. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: test. The check makes no search and no model call for an item of this class.

    Tool: none found

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

  6. added
    status/ready
    and removed
    status/new
    on Nov 16, 2026
  7. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 9f40f15 (see proposed design in issue body).

    Moved to new items: dan-petty/homelab#363, dan-petty/homelab#364.

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

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

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/agentstatus/newtype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions