From 987b91926d808682fbb89d03014bf081b0d19f1f Mon Sep 17 00:00:00 2001 From: Loringtonian <150412064+Loringtonian@users.noreply.github.com> Date: Tue, 13 Jan 2026 12:31:57 -0500 Subject: [PATCH] fix: Overview panels now respect dashboard time range 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 --- claude-code-dashboard.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/claude-code-dashboard.json b/claude-code-dashboard.json index 1bf66e2..e9b35cc 100644 --- a/claude-code-dashboard.json +++ b/claude-code-dashboard.json @@ -86,13 +86,13 @@ "type": "prometheus", "uid": "prometheus" }, - "expr": "sum(increase(claude_code_session_count_total{job=\"otel-collector\"}[1h]))", + "expr": "sum(increase(claude_code_session_count_total{job=\"otel-collector\"}[$__range]))", "interval": "", - "legendFormat": "Sessions (1h)", + "legendFormat": "Sessions", "refId": "A" } ], - "title": "Active Sessions (1h)", + "title": "Active Sessions", "type": "stat" }, { @@ -152,13 +152,13 @@ "type": "prometheus", "uid": "prometheus" }, - "expr": "sum(increase(claude_code_cost_usage_USD_total{job=\"otel-collector\"}[1h]))", + "expr": "sum(increase(claude_code_cost_usage_USD_total{job=\"otel-collector\"}[$__range]))", "interval": "", - "legendFormat": "Cost (1h)", + "legendFormat": "Cost", "refId": "A" } ], - "title": "Cost (Last Hour)", + "title": "Cost", "type": "stat" }, { @@ -218,13 +218,13 @@ "type": "prometheus", "uid": "prometheus" }, - "expr": "sum(increase(claude_code_token_usage_tokens_total{job=\"otel-collector\"}[1h]))", + "expr": "sum(increase(claude_code_token_usage_tokens_total{job=\"otel-collector\"}[$__range]))", "interval": "", - "legendFormat": "Tokens (1h)", + "legendFormat": "Tokens", "refId": "A" } ], - "title": "Token Usage (1h)", + "title": "Token Usage", "type": "stat" }, { @@ -284,13 +284,13 @@ "type": "prometheus", "uid": "prometheus" }, - "expr": "sum(increase(claude_code_lines_of_code_count_total{job=\"otel-collector\"}[1h]))", + "expr": "sum(increase(claude_code_lines_of_code_count_total{job=\"otel-collector\"}[$__range]))", "interval": "", - "legendFormat": "Lines Changed (1h)", + "legendFormat": "Lines Changed", "refId": "A" } ], - "title": "Lines of Code (1h)", + "title": "Lines of Code", "type": "stat" }, {