feat(triage): add yardstick proxy fallback for Grafana auto-query - #20905
Open
vbudhram wants to merge 2 commits into
Open
feat(triage): add yardstick proxy fallback for Grafana auto-query#20905vbudhram wants to merge 2 commits into
vbudhram wants to merge 2 commits into
Conversation
Because: - Grafana auto-query (Phase 2G) previously required the Grafana MCP server, which needs a Claude Code restart to load and so can't be enabled mid-run. - The mzcld proxy already exposes Grafana at localhost:3000 in many setups. This commit: - Adds a $GRAFANA_MODE probe (mcp | yardstick | skipped) in Phase 1F.1. - Documents the yardstick HTTP-API path for Phase 2G, mapping each MCP step to its Grafana API equivalent over the proxy, deferring datasource UIDs and GMP conventions to the yardstick-grafana skill. - Threads grafana_source: "yardstick" through the status table and frontmatter. - Adds Skill to allowed-tools so the skill can invoke yardstick-grafana.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the fxa-triage Claude skill documentation and configuration to support Grafana auto-query via a local mzcld proxy (“yardstick” fallback) when the Grafana MCP server isn’t available, and threads the resulting mode (mcp/yardstick/skipped) through the run workflow and report metadata.
Changes:
- Adds a Phase 1 probe that sets
$GRAFANA_MODEby checking Grafana MCP first, then falling back to alocalhost:3000yardstick/proxy health check. - Documents how Phase 2G’s MCP-based Grafana workflow maps to Grafana HTTP API calls via the proxy (dashboard fetch, query, render, deeplinks).
- Updates status table and report frontmatter semantics to distinguish
"yardstick"from"mcp"/"manual"/"skipped", and allows invoking a supporting yardstick Grafana skill.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| **Yardstick fallback (`$GRAFANA_MODE=yardstick`):** No `grafana` MCP server is configured, so query Grafana through its HTTP API over the `mzcld` proxy at `http://localhost:3000` instead. Invoke the `yardstick:yardstick-grafana` skill first for the canonical datasource UIDs and GMP query conventions. Never call `https://yardstick.mozilla.org` directly (it's behind IAP); the proxy handles auth, so no token header is needed on `localhost` calls. Map each step above to: | ||
|
|
||
| - **Discover panel queries** (step 1) — `GET http://localhost:3000/api/dashboards/uid/<uid>`, then read `.dashboard.panels[].targets[]`; each target's `datasource`, `expr` (Prometheus) or `rawSql` (SQL datasources) is what steps 2a/2b need. | ||
| - **Run queries** (step 2) — `POST http://localhost:3000/api/ds/query` with the same body shape already documented in 2b (works for both Prometheus and non-Prometheus targets), `from: "now-7d"`, `to: "now"`. Parse `results.A.frames` for the series. |
…t, fix auth) Because: - The yardstick fallback was written from inference before the SRE "How to Use Grafana with Claude Code" doc was available, and got the auth model wrong: it claimed the mzcld proxy handles Grafana auth so no token is needed. The proxy injects only the Google IAP token; Grafana API calls still require a Grafana Service Account token. This commit: - Corrects the auth model: API calls carry Authorization: Bearer <SA token>, sourced from 1Password/env and never printed. - Switches the liveness probe to the unauthenticated /api/health endpoint (was /api/datasources, which needs a token and gave an ambiguous signal). - Makes gcx the preferred transport (SRE-preferred agentic CLI) with raw HTTP-over-proxy as fallback; keeps HTTP for dashboard-panel discovery, which gcx has no command for. - Documents the mzcld proxy start command, the gcp-v2 datasource UIDs, GMP query caveats, and a gcx|http transport marker in grafana_notes.
dschom
reviewed
Aug 5, 2026
| Grafana auto-query (Phase 2G) has two paths. Probe them in order and record the result as `$GRAFANA_MODE`: | ||
|
|
||
| > **Image rendering capability:** `mcp__grafana__get_panel_image` requires the Grafana Image Renderer plugin to be installed server-side. Phase 2G uses image rendering only opportunistically — metric data from `query_prometheus` is always primary, panel PNGs are a bonus when available. | ||
| 1. **MCP path (`$GRAFANA_MODE=mcp`).** Test with a minimal `mcp__grafana__list_datasources` call. If it returns the FxA datasources (the Prometheus datasource `grafana.prometheus_datasource_uid` from the operational config, or whichever current UID is in use), the Grafana MCP server is configured — Phase 2G runs via MCP tools. |
Contributor
There was a problem hiding this comment.
Just curious, does this path work for you?
dschom
approved these changes
Aug 5, 2026
dschom
approved these changes
Aug 5, 2026
dschom
left a comment
Contributor
There was a problem hiding this comment.
Thanks! I'll be trying this out when I'm RO.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Because
This pull request
$GRAFANA_MODEprobe (mcp|yardstick|skipped) in Phase 1F.1, testing the proxy with alocalhost:3000health check when no Grafana MCP server is presentmcp__grafana__*step to its Grafana REST equivalent over the proxy (dashboard/query/render/deeplink)yardstick:yardstick-grafanaskillgrafana_source: "yardstick"through the status table, Phase 1I choices, and report frontmatterSkilltoallowed-toolsso the skill can invokeyardstick-grafanaIssue that this pull request solves
N/A — internal agent-tooling change, no Jira ticket.
Checklist