{ "uid": "hyperhive-claude-usage", "title": "hyperhive · claude usage", "description": "How Claude is used, by model, effort, token type, and source.", "tags": ["hyperhive", "claude"], "timezone": "utc", "schemaVersion": 39, "version": 2, "editable": true, "refresh": "1m", "time": { "from": "now-6h", "to": "now" }, "templating": { "list": [ { "name": "hive", "label": "Hive", "type": "query", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "query": "label_values({__name__=\"claude_code.cost.usage\"}, hive)", "refresh": 2, "includeAll": true, "allValue": ".*", "multi": true, "current": { "text": "All", "value": "$__all" }, "sort": 1 }, { "name": "agent", "label": "Agent", "type": "query", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "query": "label_values({__name__=\"claude_code.cost.usage\", hive=~\"$hive\"}, agent)", "refresh": 2, "includeAll": true, "allValue": ".*", "multi": true, "current": { "text": "All", "value": "$__all" }, "sort": 1 } ] }, "panels": [ { "id": 1, "type": "stat", "title": "Cost", "description": "Total USD spent on Claude Code usage.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 4, "w": 4, "x": 0, "y": 0 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum(increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", "instant": true } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 2, "color": { "mode": "fixed", "fixedColor": "purple" } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "textMode": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 2, "type": "stat", "title": "Tokens", "description": "Total tokens used, across all types.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 4, "w": 4, "x": 4, "y": 0 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", "instant": true } ], "fieldConfig": { "defaults": { "unit": "short", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "blue" } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "textMode": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 3, "type": "stat", "title": "Cache read share", "description": "Cache-read tokens as a fraction of all tokens.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 4, "w": 4, "x": 8, "y": 0 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"cacheRead\"}[$__range])) / sum(increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", "instant": true } ], "fieldConfig": { "defaults": { "unit": "percentunit", "decimals": 1, "color": { "mode": "fixed", "fixedColor": "green" } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "textMode": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 4, "type": "stat", "title": "Active time", "description": "Seconds actually spent working.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 4, "w": 4, "x": 12, "y": 0 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum(increase({__name__=\"claude_code.active_time.total\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", "instant": true } ], "fieldConfig": { "defaults": { "unit": "s", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "orange" } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "textMode": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 10, "type": "timeseries", "title": "Token rate by type", "description": "Tokens per minute, split by type.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "interval": "10m", "gridPos": { "h": 7, "w": 12, "x": 0, "y": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum by (type) (rate({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) * 60", "legendFormat": "{{type}}" } ], "fieldConfig": { "defaults": { "unit": "short", "decimals": 0, "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never", "spanNulls": false, "axisSoftMin": 0, "scaleDistribution": { "type": "log", "log": 10 } } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true, "calcs": [] }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 11, "type": "bargauge", "title": "Tokens by model", "description": "Tokens used, split by model.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 4 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sort_desc(sum by (model) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{model}}" } ], "fieldConfig": { "defaults": { "unit": "short", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "blue" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "blue", "value": null } ] } }, "overrides": [] }, "options": { "displayMode": "basic", "orientation": "horizontal", "showUnfilled": true, "valueMode": "text", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 20, "type": "timeseries", "title": "Cost rate by model", "description": "USD per minute, split by model.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "interval": "10m", "gridPos": { "h": 7, "w": 12, "x": 0, "y": 11 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum by (model) (rate({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__rate_interval])) * 60", "legendFormat": "{{model}}" } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 3, "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 10, "showPoints": "never", "spanNulls": false, "axisSoftMin": 0 } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true, "calcs": [] }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 21, "type": "bargauge", "title": "Cost by effort", "description": "USD spent, split by effort level.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 7, "w": 6, "x": 12, "y": 11 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sort_desc(sum by (effort) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{effort}}" } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 2, "color": { "mode": "fixed", "fixedColor": "purple" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "purple", "value": null } ] } }, "overrides": [] }, "options": { "displayMode": "basic", "orientation": "horizontal", "showUnfilled": true, "valueMode": "text", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 22, "type": "bargauge", "title": "Cost by query source", "description": "USD spent, split by main vs. auxiliary queries.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 7, "w": 6, "x": 18, "y": 11 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sort_desc(sum by (query_source) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{query_source}}" } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 2, "color": { "mode": "fixed", "fixedColor": "orange" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "orange", "value": null } ] } }, "overrides": [] }, "options": { "displayMode": "basic", "orientation": "horizontal", "showUnfilled": true, "valueMode": "text", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 30, "type": "bargauge", "title": "Edit tool decisions by language", "description": "Edit-tool accept/reject decisions, split by language.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 18 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sort_desc(sum by (language, decision) (increase({__name__=\"claude_code.code_edit_tool.decision\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{language}} · {{decision}}" } ], "fieldConfig": { "defaults": { "unit": "short", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "green" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [] }, "options": { "displayMode": "basic", "orientation": "horizontal", "showUnfilled": true, "valueMode": "text", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 31, "type": "bargauge", "title": "Edit tool decisions by tool", "description": "Edit-tool accept/reject decisions, split by tool.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 18 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sort_desc(sum by (tool_name, decision) (increase({__name__=\"claude_code.code_edit_tool.decision\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{tool_name}} · {{decision}}" } ], "fieldConfig": { "defaults": { "unit": "short", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "yellow" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "yellow", "value": null } ] } }, "overrides": [] }, "options": { "displayMode": "basic", "orientation": "horizontal", "showUnfilled": true, "valueMode": "text", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 5, "type": "stat", "title": "Turns", "description": "Number of Claude turns run.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 0 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum(increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", "instant": true } ], "fieldConfig": { "defaults": { "unit": "short", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "text" } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "textMode": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 6, "type": "stat", "title": "Active time per turn", "description": "Average active seconds per turn.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 4, "w": 4, "x": 20, "y": 0 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum(increase({__name__=\"claude_code.active_time.total\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])) / sum(increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))", "instant": true } ], "fieldConfig": { "defaults": { "unit": "s", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "orange" } }, "overrides": [] }, "options": { "colorMode": "value", "graphMode": "none", "textMode": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 40, "type": "timeseries", "title": "Turns per hour by agent", "description": "Turns per hour, per agent.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "interval": "10m", "gridPos": { "h": 7, "w": 12, "x": 0, "y": 25 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sum by (agent) (increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\"}[1h]))", "legendFormat": "{{agent}}" } ], "fieldConfig": { "defaults": { "unit": "short", "decimals": 1, "color": { "mode": "palette-classic" }, "custom": { "drawStyle": "line", "lineWidth": 1, "fillOpacity": 0, "showPoints": "never", "spanNulls": false, "axisSoftMin": 0 } }, "overrides": [] }, "options": { "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true, "calcs": [] }, "tooltip": { "mode": "multi", "sort": "desc" } } }, { "id": 41, "type": "bargauge", "title": "Active time per turn by agent", "description": "Average active seconds per turn, per agent.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 25 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.active_time.total\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])) / sum by (agent) (increase({__name__=\"claude_code.session.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } ], "fieldConfig": { "defaults": { "unit": "s", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "orange" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "orange", "value": null } ] } }, "overrides": [] }, "options": { "displayMode": "basic", "orientation": "horizontal", "showUnfilled": true, "valueMode": "text", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 42, "type": "bargauge", "title": "Cost by agent", "description": "USD spent, split by agent.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 32 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } ], "fieldConfig": { "defaults": { "unit": "currencyUSD", "decimals": 2, "color": { "mode": "fixed", "fixedColor": "purple" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "purple", "value": null } ] } }, "overrides": [] }, "options": { "displayMode": "basic", "orientation": "horizontal", "showUnfilled": true, "valueMode": "text", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } }, { "id": 43, "type": "bargauge", "title": "Tokens by agent", "description": "Tokens used, split by agent.", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 32 }, "targets": [ { "refId": "A", "datasource": { "type": "prometheus", "uid": "@datasourceUid@" }, "expr": "sort_desc(sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range])))", "instant": true, "legendFormat": "{{agent}}" } ], "fieldConfig": { "defaults": { "unit": "short", "decimals": 0, "color": { "mode": "fixed", "fixedColor": "blue" }, "thresholds": { "mode": "absolute", "steps": [ { "color": "blue", "value": null } ] } }, "overrides": [] }, "options": { "displayMode": "basic", "orientation": "horizontal", "showUnfilled": true, "valueMode": "text", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false } } } ] }