Skip to content

chore(telemetry): verify MCP tool error warnings in Loki #6237

Open

Description

@devops-cli-service

Split from #5457.

Problem: The fix adds a warning record for each failed in-process MCP tool call. Operators must see these records in Loki, with the tool label and the class, to count failures. Why deferred: This check needs the merged fix on a deployed service and a real failed MCP tool call. It cannot run offline in the pull request that changes the dispatcher. Acceptance criteria: - A Loki query over the deployment shows at least one warning record from a failed in-process MCP tool call. - The record holds the tool label and the exception class. - The record does not hold the exception message. - The issue records the query and its time range.

Proposed design

Problem statement

Operators cannot count failed in-process MCP tool calls until the warning records of #5457 reach Loki. This item documents the LogQL query on the operator page and records one live check after the merge.

Acceptance criteria

Requirement: Operator page holds the query

docs/CLUSTER.md SHALL hold a LogQL query that selects the service_name="devops-mcp-server" stream and the warning level for failed in-process MCP tool calls.

Scenario: Docs row accepts the changed page

  • WHEN The branch runs uv run devops ci --check --only docs.
  • THEN The docs row of Static Analysis passes with exit code 0.

Requirement: Live check returns a warning record

The recorded LogQL query MUST return at least one warning record from a failed in-process MCP tool call after the merge.

Scenario: Pending a person after the merge

  • WHEN After the merge, an operator runs the recorded query in Grafana Explore after a failed in-process MCP tool call.
  • THEN The query returns at least one warning record for that failed call.

Requirement: Record holds the tool label and the class

Each returned warning record MUST hold the tool label and the exception class.

Scenario: Pending a person after the merge

  • WHEN After the merge, an operator opens one returned warning record in Grafana Explore.
  • THEN The record holds the tool label and the exception class.

Requirement: Record omits the exception message

A returned warning record MUST NOT hold the exception message.

Scenario: Pending a person after the merge

  • WHEN After the merge, an operator opens one returned warning record in Grafana Explore.
  • THEN The record holds no exception message text.

Requirement: Issue records the query and the range

The issue MUST hold the query, its time range and the observed record, so a later operator can repeat the check.

Scenario: Pending a person after the merge

  • WHEN After the merge, the operator finishes the live check.
  • THEN The issue holds the query, the time range and the observed record.

Existing Tool Considered

No alternatives check has run on this item. Grafana Loki, queried in Grafana Explore, is the open, maintained log store and query interface that covers the need. This item builds no code. Loki covers the LogQL query and the view of a record's line and metadata. Loki lacks the record itself: the fix of #5457 writes it, and only a real failed in-process MCP tool call produces it.

Key questions

  • Which deployed process writes the warning record of a failed in-process MCP tool call?: The devops-mcp-server Deployment runs the in-process dispatcher. Its pod sends OTLP log records to Loki under the service name devops-mcp-server. [sources: k8s/devops/mcp-server/deployment.yaml, src/devops_cli/ai/mcp/dispatcher.py, docs/CLUSTER.md]
  • Where does the item document the LogQL query so an operator can repeat it?: docs/CLUSTER.md. It is the hand-written operator page for the deployed pods. It already sends a person to Grafana Explore for a query. (best practice) [sources: docs/CLUSTER.md]
    • Chosen: docs/CLUSTER.md. It is the hand-written operator page. It already names Grafana Explore.
    • Rejected: The issue only. An operator who looks for the query later needs a page, not a closed issue.
  • Which client runs the LogQL query?: Grafana Explore on the loki data source. The operator page already sends a person there. Explore shows the line of a record and its metadata. (best practice) [sources: docs/CLUSTER.md]
    • Chosen: Grafana Explore. The operator page already sends a person to Grafana Explore. Explore shows the line and metadata of a record.
    • Rejected: curl on /loki/api/v1/query_range. The operator must build the URL and encode the query. The issue records a query, not a request.
  • How does the query find a failed in-process MCP tool call?: The query selects the service_name="devops-mcp-server" stream and the warning level that discover_log_levels fills. It filters the record by the tool label that fix(mcp): in-process tool errors return the masked message #5457 adds. The operator writes the final query into the issue at the live check, so the exact filter follows the merged record. (best practice) [sources: k8s/devops/mcp-server/deployment.yaml, src/devops_cli/grafana/service_dashboard.py, docs/CLUSTER.md]
    • Chosen: Stream selector, warning level and tool label. The MCP server pod writes the record under this stream. The dashboards already filter the level that discover_log_levels fills.
    • Rejected: A fixed line filter written before fix(mcp): in-process tool errors return the masked message #5457 merges. The fix is not merged. A line filter written now can name text that the fix does not write.
    • Rejected: The namespace and pod labels of the container log path. That path holds the text of the container log. The OTLP log stream holds the record that the dashboards select.
    • Rejected: The text of the exception message. The record holds no exception message, so the query cannot match it.

Fit

Fits in one pull request.

Suspected block

A real failed in-process MCP tool call on the deployed devops-mcp-server pod after #5457 merges and deploys.

Dependencies

#5457

Watched files

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

  • k8s/devops/mcp-server/deployment.yaml
  • src/devops_cli/ai/mcp/dispatcher.py

Activity

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

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

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 6ff83d4 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.

  4. 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.

  5. 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