Watch
0
0
Fork
You've already forked hyperhive
0

agents board: a busiest-agents table, joined by agent

Five instant table-format queries, one per column, joined on the agent label,
sorted by turns. Checked in a real Grafana 13 against a mock Prometheus.
This commit is contained in:
iris 2026-11-01 13:21:09 +01:00
commit fec66af1c8

View file

@ -2353,6 +2353,202 @@
}
}
}
},
"panel-67": {
"kind": "Panel",
"spec": {
"id": 67,
"title": "Busiest agents",
"description": "Turns, tokens and cost per agent in the selected range, busiest first.",
"links": [],
"data": {
"kind": "QueryGroup",
"spec": {
"queries": [
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "prometheus",
"version": "v0",
"datasource": {
"name": "@datasourceUid@"
},
"spec": {
"expr": "sum by (agent) (increase({__name__=\"hyperhive.agent.turn.count\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))",
"instant": true,
"format": "table"
}
},
"refId": "A",
"hidden": false
}
},
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "prometheus",
"version": "v0",
"datasource": {
"name": "@datasourceUid@"
},
"spec": {
"expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"input\"}[$__range]))",
"instant": true,
"format": "table"
}
},
"refId": "B",
"hidden": false
}
},
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "prometheus",
"version": "v0",
"datasource": {
"name": "@datasourceUid@"
},
"spec": {
"expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"output\"}[$__range]))",
"instant": true,
"format": "table"
}
},
"refId": "C",
"hidden": false
}
},
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "prometheus",
"version": "v0",
"datasource": {
"name": "@datasourceUid@"
},
"spec": {
"expr": "sum by (agent) (increase({__name__=\"claude_code.token.usage\", hive=~\"$hive\", agent=~\"$agent\", type=\"cacheRead\"}[$__range]))",
"instant": true,
"format": "table"
}
},
"refId": "D",
"hidden": false
}
},
{
"kind": "PanelQuery",
"spec": {
"query": {
"kind": "DataQuery",
"group": "prometheus",
"version": "v0",
"datasource": {
"name": "@datasourceUid@"
},
"spec": {
"expr": "sum by (agent) (increase({__name__=\"claude_code.cost.usage\", hive=~\"$hive\", agent=~\"$agent\"}[$__range]))",
"instant": true,
"format": "table"
}
},
"refId": "E",
"hidden": false
}
}
],
"queryOptions": {},
"transformations": [
{
"kind": "joinByField",
"spec": {
"id": "joinByField",
"options": {
"byField": "agent",
"mode": "outer"
}
}
},
{
"kind": "organize",
"spec": {
"id": "organize",
"options": {
"excludeByName": {
"Time": true
},
"renameByName": {
"agent": "Agent",
"Value #A": "Turns",
"Value #B": "Input tokens",
"Value #C": "Output tokens",
"Value #D": "Cache read tokens",
"Value #E": "Cost"
},
"indexByName": {
"agent": 0,
"Value #A": 1,
"Value #B": 2,
"Value #C": 3,
"Value #D": 4,
"Value #E": 5
}
}
}
}
]
}
},
"vizConfig": {
"kind": "VizConfig",
"group": "table",
"version": "",
"spec": {
"options": {
"showHeader": true,
"sortBy": [
{
"displayName": "Turns",
"desc": true
}
]
},
"fieldConfig": {
"defaults": {
"unit": "short",
"decimals": 0
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Cost"
},
"properties": [
{
"id": "unit",
"value": "currencyUSD"
},
{
"id": "decimals",
"value": 2
}
]
}
]
}
}
}
}
}
},
"layout": {
@ -2444,6 +2640,19 @@
"name": "panel-60"
}
}
},
{
"kind": "GridLayoutItem",
"spec": {
"x": 0,
"y": 23,
"width": 24,
"height": 8,
"element": {
"kind": "ElementReference",
"name": "panel-67"
}
}
}
]
}