Watch
0
0
Fork
You've already forked hyperhive
0

agent: export swarm-queue connected gauge and skipped-publish counter, with dashboard panels

This commit is contained in:
atlas 2026-11-07 01:31:47 +01:00 • committed by mara
commit e9025823d9

View file

@ -505,6 +505,32 @@ let
]
&& (lib.head xf).spec.options.byField == "agent";
}
{
# The agents board's health tab reads the swarm-queue connection gauge and
# the skipped-publish counter the harness records. A renamed instrument is a
# pair of empty panels, so each must still be spelled in the harness; and the
# connection panel only tells an older build (no series) from a detached
# agent (0) while it falls back to the container metrics for the agent list.
name = "the agents dashboard's health tab reads the swarm-queue metrics the harness records";
ok =
let
board = builtins.fromJSON (builtins.readFile ../host-modules/swarm-grafana/dashboards/agents.json);
tab = lib.findFirst (t: t.spec.title == "health") null board.spec.layout.spec.tabs;
names = map (i: i.spec.element.name) tab.spec.layout.spec.items;
exprs = lib.concatMap (
n: map (q: q.spec.query.spec.expr) board.spec.elements.${n}.spec.data.spec.queries
) names;
recorded = builtins.readFile ../../hive-agent/src/otel_turn_metrics.rs;
connected = lib.findFirst (e: lib.hasInfix "swarm_queue.connected" e) "" exprs;
in
tab != null
&& lib.all (m: lib.hasInfix "\"${m}\"" recorded) [
"hyperhive.agent.swarm_queue.connected"
"hyperhive.agent.swarm_queue.publish_skipped"
]
&& lib.any (e: lib.hasInfix "swarm_queue.publish_skipped" e) exprs
&& lib.hasInfix "hyperhive.container.cpu.percent" connected;
}
{
# The agents board's turns tab reads the turn, tool, bash command, reminder
# and session metrics the harness records, grouped by the labels it sets on them. A renamed instrument or