Watch
0
0
Fork
You've already forked hyperhive
0

grafana: the claude usage dashboard shows subscription usage per account against the elapsed share of its window

This commit is contained in:
damocles 2026-11-22 20:03:16 +01:00 • committed by mara
commit e1434e677b

View file

@ -1010,8 +1010,8 @@
{ {
"id": 44, "id": 44,
"type": "timeseries", "type": "timeseries",
"title": "Subscription usage, highest window", "title": "Subscription usage per account",
"description": "Highest subscription usage percent across all agents and windows.", "description": "Percent used (solid) and percent of the window elapsed (dashed), per claude account and window.",
"datasource": { "datasource": {
"type": "prometheus", "type": "prometheus",
"uid": "@datasourceUid@" "uid": "@datasourceUid@"
@ -1030,8 +1030,17 @@
"type": "prometheus", "type": "prometheus",
"uid": "@datasourceUid@" "uid": "@datasourceUid@"
}, },
"expr": "max({__name__=\"hyperhive.agent.claude_usage.percent\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"} unless on(agent, hive, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"} < time()))", "expr": "max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.percent\", account!=\"\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"} unless on(agent, hive, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"} < time()))",
"legendFormat": "highest window" "legendFormat": "{{account}} · {{window}} used"
},
{
"refId": "B",
"datasource": {
"type": "prometheus",
"uid": "@datasourceUid@"
},
"expr": "(100 * (1 - (max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", account!=\"\", window=\"seven_day\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}) - time()) / 604800)) < 100 or (100 * (1 - (max by (account, window) ({__name__=\"hyperhive.agent.claude_usage.resets_at\", account!=\"\", window=\"five_hour\", hive=~\"$hive\", \"service.name\"=~\"$service\", agent=~\"$agent\"}) - time()) / 18000)) < 100",
"legendFormat": "{{account}} · {{window}} elapsed"
} }
], ],
"fieldConfig": { "fieldConfig": {
@ -1040,24 +1049,39 @@
"min": 0, "min": 0,
"max": 100, "max": 100,
"color": { "color": {
"mode": "fixed", "mode": "palette-classic"
"fixedColor": "orange"
}, },
"custom": { "custom": {
"drawStyle": "line", "drawStyle": "line",
"lineWidth": 1, "lineWidth": 1,
"fillOpacity": 10, "fillOpacity": 0,
"showPoints": "never", "showPoints": "never",
"spanNulls": false "spanNulls": false
} }
}, },
"overrides": [] "overrides": [
{
"matcher": {
"id": "byFrameRefID",
"options": "B"
},
"properties": [
{
"id": "custom.lineStyle",
"value": {
"fill": "dash",
"dash": [10, 10]
}
}
]
}
]
}, },
"options": { "options": {
"legend": { "legend": {
"displayMode": "list", "displayMode": "list",
"placement": "bottom", "placement": "bottom",
"showLegend": false, "showLegend": true,
"calcs": [] "calcs": []
}, },
"tooltip": { "tooltip": {