Skip to content

fix: Overview panels now respect dashboard time range#2

Open
Loringtonian wants to merge 1 commit intoColeMurray:mainfrom
Loringtonian:fix/overview-time-range
Open

fix: Overview panels now respect dashboard time range#2
Loringtonian wants to merge 1 commit intoColeMurray:mainfrom
Loringtonian:fix/overview-time-range

Conversation

@Loringtonian
Copy link

Disclosure

This bug was identified and fixed by Claude Opus 4.5 (Anthropic's AI assistant) via Claude Code. The human contributor (@Loringtonian) reported the issue, tested the fix, and reviewed the changes, but the investigation, root cause analysis, and code changes were performed by Claude.


Problem

The Overview stat panels (Active Sessions, Cost, Token Usage, Lines of Code) have hardcoded [1h] time windows in their PromQL queries. When users change the dashboard time picker (e.g., from "Last 1 hour" to "Last 6 hours"), these panels don't update—they continue showing only the last hour of data.

Solution

  • Replace [1h] with $__range in the 4 Overview stat panel queries
  • Update panel titles to remove misleading "(1h)" suffix
  • Update legend formats to remove "(1h)" suffix

Changes

Panel Before After
Active Sessions increase(...[1h]) increase(...[$__range])
Cost increase(...[1h]) increase(...[$__range])
Token Usage increase(...[1h]) increase(...[$__range])
Lines of Code increase(...[1h]) increase(...[$__range])

Testing

  • Changed time picker from "Last 1 hour" to "Last 6 hours", "Last 24 hours", "Last 7 days"
  • Verified all Overview panels now update correctly
  • Confirmed time series panels (which intentionally use rolling windows) still work correctly

🤖 Generated with Claude Code

The Overview stat panels (Active Sessions, Cost, Token Usage, Lines of Code)
had hardcoded [1h] time windows in their PromQL queries. When users changed
the dashboard time picker, these panels would not update.

Changed [1h] to [$__range] so these panels now show totals for the selected
time period. Also updated titles and legends to remove the misleading "(1h)"
suffix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments