From 93ed6a977f2512614f8444193803a77a50f4fc8c Mon Sep 17 00:00:00 2001 From: iris Date: Sat, 12 Sep 2026 01:01:25 +0200 Subject: [PATCH 1/2] grafana: add a CLAUDE.md-size-by-agent panel to the agents dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../swarm-grafana/dashboards/agents.json | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/nix/host-modules/swarm-grafana/dashboards/agents.json b/nix/host-modules/swarm-grafana/dashboards/agents.json index f462c976..eb9804d5 100644 --- a/nix/host-modules/swarm-grafana/dashboards/agents.json +++ b/nix/host-modules/swarm-grafana/dashboards/agents.json @@ -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 + } + } } ] } From d34c6618dfe4bf135ca1b415d6fb63c9889acd3b Mon Sep 17 00:00:00 2001 From: iris Date: Sat, 12 Sep 2026 01:11:28 +0200 Subject: [PATCH 2/2] grafana: switch the CLAUDE.md-size panel from a snapshot bar to a time series MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mara, PR review: "i want to see it over time - sounds like you built bar chart?" — correct, it was a bargauge (instant/lastNotNull). Switched to timeseries, matching the CPU/memory-by-agent panels' own treatment of a plain live gauge (raw value plotted across the range, no rate()/ increase() since it's not a cumulative counter). --- .../swarm-grafana/dashboards/agents.json | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/nix/host-modules/swarm-grafana/dashboards/agents.json b/nix/host-modules/swarm-grafana/dashboards/agents.json index eb9804d5..2ee0cb4a 100644 --- a/nix/host-modules/swarm-grafana/dashboards/agents.json +++ b/nix/host-modules/swarm-grafana/dashboards/agents.json @@ -661,15 +661,15 @@ }, { "id": 33, - "type": "bargauge", + "type": "timeseries", "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.", + "description": "hyperhive.agent.claude_md.lines over time — mara: \"i want to see it over time\" (a bargauge snapshot in an earlier round of this panel only showed the current count). A continuously-live gauge, not a per-turn counter, so this is the raw value plotted across the range, same treatment as the CPU/memory-by-agent panels above rather than a rate()/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, + "h": 8, "w": 12, "x": 0, "y": 27 @@ -682,7 +682,6 @@ "uid": "@datasourceUid@" }, "expr": "sum by (agent) ({__name__=\"hyperhive.agent.claude_md.lines\", hive=~\"$hive\", agent=~\"$agent\"})", - "instant": true, "legendFormat": "{{agent}}" } ], @@ -691,30 +690,29 @@ "unit": "short", "decimals": 0, "color": { - "mode": "fixed", - "fixedColor": "orange" + "mode": "palette-classic" }, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "orange", - "value": null - } - ] + "custom": { + "drawStyle": "line", + "lineWidth": 1, + "fillOpacity": 0, + "showPoints": "never", + "spanNulls": false, + "axisSoftMin": 0 } }, "overrides": [] }, "options": { - "displayMode": "basic", - "orientation": "horizontal", - "showUnfilled": true, - "valueMode": "text", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true, + "calcs": [] + }, + "tooltip": { + "mode": "multi", + "sort": "desc" } } }