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}}" } ],