Skip to content

fix(observability): restore historical continuity in the AI Usage and GPU Metrics dashboards#6804

Merged
JSONbored merged 2 commits into
mainfrom
fix/ai-usage-dashboard-history-continuity
Jul 17, 2026
Merged

fix(observability): restore historical continuity in the AI Usage and GPU Metrics dashboards#6804
JSONbored merged 2 commits into
mainfrom
fix/ai-usage-dashboard-history-continuity

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Scope

  • Narrow, single-purpose change (2 dashboards + their tests, same bug class)
  • No secrets/private terms touched
  • No changelog edit

Validation

  • npx vitest run test/unit/selfhost-grafana-ai-usage-dashboard.test.ts test/unit/selfhost-grafana-gpu-metrics-dashboard.test.ts — 13/13 passing
  • Every rewritten query confirmed valid + returning real data against live production Prometheus before deploying
  • Confirmed zero remaining un-unioned loopover_ai_*/loopover_ai_provider_* queries in either file, and zero label-after-paren syntax issues

…hboard

#5522's hard-cutover rename of the gittensory_ metric prefix to loopover_
left this dashboard's 9 loopover_ai_* queries with no fallback to their
pre-rebrand names, so every panel here only ever showed data recorded
after that cutover -- confirmed live, both metric names have real
historical series in Prometheus going back well past the cutover.

Applies the same (loopover_x or gittensory_x) union fix already shipped
for grafana/dashboards/gittensory.json (#6779/#6787), including that
fix's own lesson: a label matcher like {provider="codex"} must bind to
each side of the union individually, never to the closing paren of the
union as a whole -- verified all 9 rewritten queries directly against
live Prometheus before deploying.

Deployed to edge-nl-01 and restarted Grafana to force a clean reprovision.
…dashboard

Same #5522 hard-cutover gap as ai-usage.json: the 3 AI-provider request
metrics (rate/latency/error-rate panels) had no fallback to their
pre-rebrand gittensory_ names, truncating history to the post-cutover
window. All 3 metrics confirmed to have real historical series in
Prometheus under the old name before applying the union fix.

No existing test file covered this dashboard at all -- added one scoped
to this fix rather than backfilling full dashboard coverage.

Deployed to edge-nl-01 and restarted Grafana to force a clean reprovision.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.63%. Comparing base (e275417) to head (acb5597).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6804   +/-   ##
=======================================
  Coverage   93.63%   93.63%           
=======================================
  Files         683      683           
  Lines       68148    68148           
  Branches    18703    18703           
=======================================
  Hits        63812    63812           
  Misses       3350     3350           
  Partials      986      986           
Flag Coverage Δ
shard-1 43.57% <ø> (-0.06%) ⬇️
shard-2 36.88% <ø> (+0.15%) ⬆️
shard-3 32.75% <ø> (ø)
shard-4 33.64% <ø> (-0.57%) ⬇️
shard-5 31.46% <ø> (-0.11%) ⬇️
shard-6 45.88% <ø> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 17, 2026
@loopover-orb

loopover-orb Bot commented Jul 17, 2026

Copy link
Copy Markdown

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-17 07:16:28 UTC

4 files · 1 AI reviewer · 2 blockers · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This PR extends the (loopover_x or gittensory_x) union pattern from the already-merged #6787 fix to two more dashboards (ai-usage.json, gpu-metrics.json) that lost historical continuity in the #5522 rename. The label-matcher placement is correct in every rewritten expression — {provider="codex"} is applied inside each individual rate()/increase() call rather than after the closing paren of the union, avoiding the exact bug #6787 fixed. Tests assert byte-for-byte expected expressions and include a regex guard against the label-after-paren regression, and a new test file was added for gpu-metrics.json which previously had none.

Nits — 4 non-blocking

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.

2. Maintainer requires a linked issue — Link the relevant issue (for example `Closes #123`) before opening the PR.

Decision drivers

  • ❌ Code review — 2 blockers (1 reviewer)
  • ❌ Gate result — Blocking (Repo-configured hard blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 33 registered-repo PR(s), 26 merged, 332 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 33 PR(s), 332 issue(s).
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: moderate
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • Official Gittensor activity: 33 PR(s), 332 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Then work through the remaining 2 steps in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 17, 2026
@JSONbored
JSONbored merged commit c9fcf90 into main Jul 17, 2026
18 checks passed
@JSONbored
JSONbored deleted the fix/ai-usage-dashboard-history-continuity branch July 17, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant