grafana: add a CLAUDE.md-size-by-agent panel to the agents dashboard

Closes #4284. hyperhive.agent.claude_md.lines is already exported (see
hive-agent's claude_md_watch module) but had no dashboard panel — this
is the display half.

Same bargauge shape as the two sibling per-agent gauges already in this
file (container storage, active time): sum by (agent), instant query,
lastNotNull reduction, since it's a continuously-live gauge rather than
a cumulative counter. Metric name uses the dotted OTLP form per this
file's own documented convention for this store.
This commit is contained in:
iris 2026-09-12 01:01:25 +02:00 committed by mara
commit 93ed6a977f

View file

@ -658,6 +658,65 @@
"values": false
}
}
},
{
"id": 33,
"type": "bargauge",
"title": "CLAUDE.md size by agent",
"description": "hyperhive.agent.claude_md.lines — current line count of each agent's own CLAUDE.md, a continuously-live gauge (not a per-turn counter, hence lastNotNull rather than increase()). The harness itself raises a loose-ends todo past 500 lines suggesting a trim, not a hard limit — this panel is visibility, not an alarm.",
"datasource": {
"type": "prometheus",
"uid": "@datasourceUid@"
},
"gridPos": {
"h": 7,
"w": 12,
"x": 0,
"y": 27
},
"targets": [
{
"refId": "A",
"datasource": {
"type": "prometheus",
"uid": "@datasourceUid@"
},
"expr": "sum by (agent) ({__name__=\"hyperhive.agent.claude_md.lines\", hive=~\"$hive\", agent=~\"$agent\"})",
"instant": true,
"legendFormat": "{{agent}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short",
"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
}
}
}
]
}