Skip to content

chore(telemetry): verify backend labels in Prometheus after release #6497

Open

Description

@devops-cli-service

Split from #5546.

The backend label of devops_cli_ai_requests_total must name the provider of a hosted gateway call, such as openrouter, after the fix of #5546 is released. The check reads the Prometheus of the cluster, which the change cannot reach before the merge and the rollout. The fix and its tests are in #5546; this item checks the live series only, so #5546 can reach Ready without it. This item waits on the release of #5546 and on the owner's Prometheus, and it is Blocked until then. Its acceptance criteria: after the release, sum by (server, backend, provider, model) (increase(devops_cli_ai_requests_total{cached=false}[24h])) returns no series with an empty backend label for a hosted model such as deepseek-v4.1-flash-1017; the same query returns backend=openrouter for the openrouter series and backend=ollama-48gib-fast for the Ollama series.

Proposed design

Problem statement

Verify the live backend labels of devops_cli_ai_requests_total after the release of #5546. The fix and its tests are in #5546. This item adds no code. It waits on the owner's Prometheus and on the release.

Acceptance criteria

Requirement: Pending a person after the merge

The operator SHALL supply PROMETHEUS_URL and a read credential, run the three live checks after the release of #5546, and record each JSON result as a comment.

Scenario: The operator runs the live checks

  • WHEN The operator supplies PROMETHEUS_URL and a read credential of the cluster Prometheus and runs the three live checks after the release and rollout of fix(ai): a hosted gateway call names its provider as backend #5546.
  • THEN Each live check prints true and exits 0, and the operator records the JSON result of each check as a comment on the issue.

Requirement: Hosted series carry a backend

Each series of devops_cli_ai_requests_total with a non-empty provider label SHALL carry a non-empty backend label after the release of #5546.

Scenario: Hosted series show a backend

  • WHEN The live check curl -sG "$PROMETHEUS_URL/api/v1/query" --data-urlencode 'query=sum by (server, backend, provider, model) (increase(devops_cli_ai_requests_total{cached="false"}[24h]))' | jq -e '[.data.result[] | select((.metric.provider // "") != "") | select((.metric.backend // "") == "")] | length == 0' runs against the cluster Prometheus after the release and rollout of fix(ai): a hosted gateway call names its provider as backend #5546.
  • THEN The live check prints true and exits 0, which shows that no hosted series has an empty backend label.

Requirement: OpenRouter series carry openrouter

The backend label SHALL be openrouter for each series that the OpenRouter provider serves.

Scenario: OpenRouter series show openrouter

  • WHEN The live check curl -sG "$PROMETHEUS_URL/api/v1/query" --data-urlencode 'query=sum by (server, backend, provider, model) (increase(devops_cli_ai_requests_total{cached="false"}[24h]))' | jq -e '([.data.result[] | select(.metric.provider == "openrouter")] | length > 0) and ([.data.result[] | select(.metric.provider == "openrouter") | select(.metric.backend != "openrouter")] | length == 0)' runs against the cluster Prometheus after the release and rollout of fix(ai): a hosted gateway call names its provider as backend #5546.
  • THEN The live check prints true and exits 0, which shows at least one OpenRouter series and no OpenRouter series with another backend label.

Requirement: Ollama series carry ollama-48gib-fast

The backend label SHALL be ollama-48gib-fast for each series that the Ollama tier serves.

Scenario: Ollama series show ollama-48gib-fast

  • WHEN The live check curl -sG "$PROMETHEUS_URL/api/v1/query" --data-urlencode 'query=sum by (server, backend, provider, model) (increase(devops_cli_ai_requests_total{cached="false"}[24h]))' | jq -e '([.data.result[] | select(.metric.provider == "ollama")] | length > 0) and ([.data.result[] | select(.metric.provider == "ollama") | select(.metric.backend != "ollama-48gib-fast")] | length == 0)' runs against the cluster Prometheus after the release and rollout of fix(ai): a hosted gateway call names its provider as backend #5546.
  • THEN The live check prints true and exits 0, which shows at least one Ollama series and no Ollama series with another backend label.

Existing Tool Considered

No alternatives check has run. Prometheus, with its HTTP query API and PromQL, is the open, maintained tool that covers the need. The cluster runs it, and its rules already read devops_cli_ai_requests_total (k8s/devops/monitoring/prometheus-rules-values.yaml). It lacks the fixed backend label until #5546 ships. It needs the URL and a read credential of the owner's cluster Prometheus. This item adds no code, so it has no build cost.

Key questions

  • How does the check read the live series of devops_cli_ai_requests_total?: Use the HTTP query API of the cluster Prometheus with curl and PromQL. Use jq -e to assert the JSON result. Record the JSON result as a comment on the issue before it closes. Add no code. (best practice) [sources: k8s/devops/monitoring/prometheus-rules-values.yaml, src/devops_cli/telemetry/instruments.py]
    • Chosen: Prometheus HTTP query API with curl and jq. The cluster stores the series, the API returns the JSON result that the check records, and the check adds no code.
    • Rejected: promtool query instant. It sends the same query and needs the same URL, and it adds a binary to install on the operator host.
    • Rejected: A new devops command. It builds and keeps code for one verification, and fix(ai): a hosted gateway call names its provider as backend #5546 holds the fix and its tests.
    • Rejected: Grafana Explore. It shows a graph and records no JSON result that the check can cite.

Fit

Fits in one pull request.

Suspected block

The owner's PROMETHEUS_URL and a read credential of the cluster Prometheus, and at least one cached="false" sample of a hosted call and of an Ollama call in the 24h window.

Dependencies

#5546

Watched files

A commit on the default branch that changes one of these files starts the next refine round.

  • src/devops_cli/telemetry/instruments.py

Activity

  1. added
    type/chore
    scope/telemetry
    source/agent
    status/new
    value/medium
    effort/low
    on Nov 20, 2026
  2. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  4. changed the title [-]chore(telemetry): verify the hosted backend label in Prometheus after the release[/-] [+]chore(telemetry): verify backend labels in Prometheus after release[/+] on Nov 20, 2026
  5. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    ContributorAuthor

    The job shortened the title of this item. The summary had 63 characters, and the limit is 60. The type and the scope stay.

    • Before: chore(telemetry): verify the hosted backend label in Prometheus after the release
    • After: chore(telemetry): verify backend labels in Prometheus after release
    • Source of the summary: the background model
  6. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See the first point of Open questions and Watched files 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

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

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  8. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files 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

  9. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files 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/lowpriority/p2-mediumscope/telemetrysource/agentstatus/newtype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions