Task · TSO-0022

Fix live Grafana dashboard accuracy and signal coverage gaps

Description

A 2026-08-27 authenticated six-hour live audit rendered 407 panels across the Tailnet and Exporter Health dashboards. No Grafana query-error banners were present, but the rendered data and generated source proved several misleading zero/no-data states, selector omissions, semantic labels, table layouts, and signal-coverage gaps.

The ACL age is the clearest correctness defect: the upstream API exposes no modification timestamp, so the collector stamps the first observation of the current ETag. The live value matched the exporter process start after a restart, not a policy edit.

Keep this one task as the collated repair unit requested by the operator. Do not put lab identifiers, device names, addresses, account IDs, or raw telemetry values in tracked notes.

Acceptance Criteria

Definition of Done

Implementation Plan

ACL correctness slice:

  1. Add failing tests for persisted ACL revision observation, authoritative audit-change persistence/non-regression, multi-tailnet checkpoint isolation, and timestamp provenance/dashboard wording.
  2. Persist the current ETag revision first-observed timestamp through the existing checkpoint store without claiming a true modification time.
  3. Persist the source timestamp of classified ACL audit events and have the ACL collector re-emit it after restarts; delayed/backfilled events must not regress it.
  4. Update scoped dashboard panels to prefer audit evidence and visibly identify the approximate revision-observation fallback; regenerate generated artifacts and signal dispositions.
  5. Run targeted, generated-artifact, PromQL, full Go/lint, review, GitSync/deployment, and authenticated live-panel checks.

Plan review: do not fabricate an upstream time, do not collapse missing audit history to zero, namespace state per tailnet, retain approximate wording when file persistence is unavailable, and keep persistence failures observable without suppressing other ACL telemetry.

Remaining campaign: map AC #2-#12 into single-owner dashboard/query/test packets; serialize generator integration; implement with focused red/green checks; regenerate; run integrated gates and CodeRabbit; publish through GitSync and recheck affected authenticated live panels before finalization.

Publication routing: deliver deploy/grafana//*.json only through the repository GitSync workflow; publish deploy/alerts/grafana-managed//*.json only with gcx resources push, then verify each surface with its own read-back.

Implementation Notes

Audit evidence (2026-08-27):

ACL correctness implementation completed locally:

Live ACL proof completed after deployment. The exact implementation revision was pulled and the service became healthy. The generated dashboard was published through its GitSync source and both the Overview summary and Security & Policy > Policy & Config > Access & ACL panel rendered the revision-first-observed fallback with no visible query error. The first restart exposed that the deployment had intentionally selected an in-memory checkpoint store because flow and audit ingestion are streamed; this reset the ACL epoch and reproduced the uptime-like defect. Switching the already-mounted state path to the file store created a checkpoint, and a second controlled restart proved persistence: a post-restart sample retained the pre-restart first-observed epoch. The authoritative audit-change metric remained absent, so no audit timestamp was fabricated. TSO-0023 tracks separating durable semantic evidence from optional poll cursors so streamed deployments cannot repeat this configuration trap.

Fan-out infrastructure note: five correctly routed Codex MAPPING lanes (Luna/medium) all failed before repository access with the same configured Responses-endpoint HTTP 404. No child edits, tracker writes, commits, deployments, or live-system actions occurred. Per the canonical route contract, no substitute route was reported as equivalent; root continued locally.

AC #2-#6 implementation progress: added a built-dashboard selector contract and fixed 38 Policy & Config Prometheus/Loki queries; added prerequisite-aware zero fallbacks for empty device populations, UDP-blocked devices, ACL auto-approvers, and profile-upload failures; replaced hard-coded 10K cardinality assumptions with tailscale2otel_series_limit utilization; exposed a Node Metrics up/total ratio and narrowed raw tables; split the mixed-unit NAT/relay panel into selector-aware hard-NAT fraction and configured peer-relay inventory panels. Focused generator tests pass; integrated generation and repository gates remain pending.

CodeRabbit organisation-plan review completed with seven findings. Fixed the two dashboard correctness findings: zero-valued series limits are filtered before utilization division with an explicit unlimited state, and posture passing numerators preserve zero only while their reporting family is present. Clarified dashboard-versus-rule publication routing in the plan. Four generated alert-link findings were checked against the title resolver and current dashboard family: the cited IDs correctly resolve to their declared unique panel titles, so no generated JSON was edited.

The exact-head GitSync dashboard job failed before publication because the destination repository had migrated from networking/ to grafana/networking/ while this workflow retained the old path. Updated the dashboard copy/prune target and added an explicit destination-directory assertion. actionlint and the internal CI workflow contract test pass. CodeRabbit was skipped for this declarative CI YAML-only repair, per policy.

Final integrated evidence: full regeneration passed; 210 dashboard generator tests and 110 alert generator tests passed; catalog disposition/coverage/dashboard gates passed; promqlcheck parsed 655 PromQL and reported zero failures while explicitly leaving 35 LogQL and 6 TraceQL expressions syntax-unparsed; root build, vet, race tests, and golangci-lint passed; every module passed build/vet/race/tidy/lint and pinned Go 1.27 govulncheck found no vulnerabilities, while the stale installed govulncheck wrapper remained a reported failure. Exact-head CI and grafana-sync both passed on e0d20a2e3ae1f8c65d2af4cc757641abc17b93c3. GitSync destination blob hashes exactly matched both local dashboards, and its commit named the exact source head. Authenticated lazy-initialized UI checks covered every repaired panel family with no visible query error; trace-class activity, CPU and heap profile activity/flamegraphs, cardinality utilization, flow aggregates, node tables/ratio, scoped policy/config panels, zero-safe populations, posture population accounting, and neutral configuration panels all rendered. Alert-rule read-back remained 123 shipped/deployed, 81 paused, zero missing/orphaned/drifted.

Final Summary

Repaired the collated Grafana accuracy and coverage defects, added generator/source regression gates, regenerated dashboards and alert links, fixed the migrated GitSync destination path, and published both delivery surfaces. Verified locally, on exact-head CI, against GitSync blob hashes and rule read-back, and through authenticated lazy-initialized live panel checks.

View the source file on GitHub