From 0912e2ca0632bc196fd7fccc4f0c30601292a4ee Mon Sep 17 00:00:00 2001 From: damocles Date: Sun, 1 Nov 2026 12:01:40 +0100 Subject: [PATCH] claude usage dashboard: count the token and cost panels as increase per step so review classifier sessions show up --- nix/host-modules/swarm-grafana/dashboards/claude-usage.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nix/host-modules/swarm-grafana/dashboards/claude-usage.json b/nix/host-modules/swarm-grafana/dashboards/claude-usage.json index ab96b404..35833b32 100644 --- a/nix/host-modules/swarm-grafana/dashboards/claude-usage.json +++ b/nix/host-modules/swarm-grafana/dashboards/claude-usage.json @@ -284,7 +284,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (type) (rate({__name__=\"claude_code.token.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__rate_interval])) * 60", + "expr": "sum by (type) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__interval])) / ($__interval_ms / 60000)", "legendFormat": "{{type}}" } ], @@ -405,7 +405,7 @@ "type": "prometheus", "uid": "@datasourceUid@" }, - "expr": "sum by (model) (rate({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__rate_interval])) * 60", + "expr": "sum by (model) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}[$__interval])) / ($__interval_ms / 60000)", "legendFormat": "{{model}}" } ],