From 728e1beb6ace17d008bc87eb7687c377c427d34a Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 1 Nov 2026 12:49:42 +0100 Subject: [PATCH 1/3] egress board: the host tables merge their frames, so they are tables and not a series dropdown A grouped stats query is one frame per group. Labels become columns, then the frames merge into rows. --- .../swarm-grafana/dashboards/egress.json | 42 +++++++++++++++++++ nix/module-eval/grafana.nix | 10 +++++ 2 files changed, 52 insertions(+) diff --git a/nix/host-modules/swarm-grafana/dashboards/egress.json b/nix/host-modules/swarm-grafana/dashboards/egress.json index b4a95281f..e21f9e461 100644 --- a/nix/host-modules/swarm-grafana/dashboards/egress.json +++ b/nix/host-modules/swarm-grafana/dashboards/egress.json @@ -797,6 +797,20 @@ } ], "transformations": [ + { + "kind": "labelsToFields", + "spec": { + "id": "labelsToFields", + "options": {} + } + }, + { + "kind": "merge", + "spec": { + "id": "merge", + "options": {} + } + }, { "kind": "organize", "spec": { @@ -1023,6 +1037,20 @@ } ], "transformations": [ + { + "kind": "labelsToFields", + "spec": { + "id": "labelsToFields", + "options": {} + } + }, + { + "kind": "merge", + "spec": { + "id": "merge", + "options": {} + } + }, { "kind": "organize", "spec": { @@ -1378,6 +1406,20 @@ } ], "transformations": [ + { + "kind": "labelsToFields", + "spec": { + "id": "labelsToFields", + "options": {} + } + }, + { + "kind": "merge", + "spec": { + "id": "merge", + "options": {} + } + }, { "kind": "organize", "spec": { diff --git a/nix/module-eval/grafana.nix b/nix/module-eval/grafana.nix index 7f766cf4d..ada37531b 100644 --- a/nix/module-eval/grafana.nix +++ b/nix/module-eval/grafana.nix @@ -496,6 +496,16 @@ let && lib.all (e: lib.hasInfix "\"TCP_\"*" e) ( lib.filter (e: lib.hasInfix access e) (exprs ++ [ agentVar.spec.query.spec.query ]) ) + # A grouped stats query is one frame per group, which a table panel shows as + # a dropdown of series; labels to columns, then a merge, makes the rows. + && lib.all ( + e: + map (t: t.spec.id) e.spec.data.spec.transformations == [ + "labelsToFields" + "merge" + "organize" + ] + ) (lib.filter (e: e.spec.vizConfig.group == "table") (lib.attrValues board.spec.elements)) && lib.hasInfix "logformat would_deny would_deny user=%[un method=%rm host=%>rd port=%>rP result=" squid && lib.hasInfix "access_log syslog:daemon.info squid !manager" squid; } From ed8635692800ec88bc38fe8d9926f7a16f33a5bb Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 1 Nov 2026 13:00:47 +0100 Subject: [PATCH 2/3] egress board: join the host tables by labels, one row per group labelsToFields and merge left a __name__ column and one row per stat on the multi-stat table. joinByLabels gives a column per stat. --- .../swarm-grafana/dashboards/egress.json | 48 +++++++------------ nix/module-eval/grafana.nix | 15 ++++-- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/nix/host-modules/swarm-grafana/dashboards/egress.json b/nix/host-modules/swarm-grafana/dashboards/egress.json index e21f9e461..c5447d8cf 100644 --- a/nix/host-modules/swarm-grafana/dashboards/egress.json +++ b/nix/host-modules/swarm-grafana/dashboards/egress.json @@ -798,17 +798,13 @@ ], "transformations": [ { - "kind": "labelsToFields", + "kind": "joinByLabels", "spec": { - "id": "labelsToFields", - "options": {} - } - }, - { - "kind": "merge", - "spec": { - "id": "merge", - "options": {} + "id": "joinByLabels", + "options": { + "join": ["dest"], + "value": "__name__" + } } }, { @@ -1038,17 +1034,13 @@ ], "transformations": [ { - "kind": "labelsToFields", + "kind": "joinByLabels", "spec": { - "id": "labelsToFields", - "options": {} - } - }, - { - "kind": "merge", - "spec": { - "id": "merge", - "options": {} + "id": "joinByLabels", + "options": { + "join": ["agent", "dest"], + "value": "__name__" + } } }, { @@ -1407,17 +1399,13 @@ ], "transformations": [ { - "kind": "labelsToFields", + "kind": "joinByLabels", "spec": { - "id": "labelsToFields", - "options": {} - } - }, - { - "kind": "merge", - "spec": { - "id": "merge", - "options": {} + "id": "joinByLabels", + "options": { + "join": ["agent", "dest", "port"], + "value": "__name__" + } } }, { diff --git a/nix/module-eval/grafana.nix b/nix/module-eval/grafana.nix index ada37531b..b4f95f9f4 100644 --- a/nix/module-eval/grafana.nix +++ b/nix/module-eval/grafana.nix @@ -496,15 +496,20 @@ let && lib.all (e: lib.hasInfix "\"TCP_\"*" e) ( lib.filter (e: lib.hasInfix access e) (exprs ++ [ agentVar.spec.query.spec.query ]) ) - # A grouped stats query is one frame per group, which a table panel shows as - # a dropdown of series; labels to columns, then a merge, makes the rows. + # A grouped stats query is one frame per group and stat, which a table panel + # shows as a dropdown of series; joining by the group labels, with the stat's + # name as the column, makes one row per group. && lib.all ( e: - map (t: t.spec.id) e.spec.data.spec.transformations == [ - "labelsToFields" - "merge" + let + xf = e.spec.data.spec.transformations; + in + map (t: t.spec.id) xf == [ + "joinByLabels" "organize" ] + && (lib.head xf).spec.options.value == "__name__" + && (lib.head xf).spec.options.join != [ ] ) (lib.filter (e: e.spec.vizConfig.group == "table") (lib.attrValues board.spec.elements)) && lib.hasInfix "logformat would_deny would_deny user=%[un method=%rm host=%>rd port=%>rP result=" squid && lib.hasInfix "access_log syslog:daemon.info squid !manager" squid; From 70901115a26c88118c51f3948ff24cb767775bea Mon Sep 17 00:00:00 2001 From: iris Date: Sun, 1 Nov 2026 13:05:36 +0100 Subject: [PATCH 3/3] docs: the egress dashboard's host lists are tables --- docs/swarm/services.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/swarm/services.md b/docs/swarm/services.md index 000fca4e8..750c6ffe5 100644 --- a/docs/swarm/services.md +++ b/docs/swarm/services.md @@ -203,7 +203,7 @@ kept. - `agents`: per-agent resource usage and Claude Code activity. - `authelia`, `bao`, `queue`: the identity provider, the secret store and the NATS queue. - `claude-usage`: Claude use by model, effort, token type and source. Filter by hive, service (agents or the review classifier) and agent. The service filter separates the classifier's API-key spend from the agents. -- `egress`: what agents send through the egress proxy, in three tabs. **overview** has the totals (requests, agents active, refused, credential challenges, data transferred), requests over time by status, and the busiest agents and destinations. **refused** lists the hosts the proxy refused for each agent. **would-deny** lists what agents in `log` mode reached that restricted mode would refuse. Filter by agent. +- `egress`: what agents send through the egress proxy, in three tabs. **overview** has the totals (requests, agents active, refused, credential challenges, data transferred), requests over time by status, and the busiest agents and destinations. **refused** lists the hosts the proxy refused for each agent. **would-deny** lists what agents in `log` mode reached that restricted mode would refuse. The host lists are tables, one row per host (and agent), with a count column you can sort. Filter by agent. - `controller`: the swarm controller's job graph by state, and the push and commit rates it sees on the forge. - `review-classifier`: review requests by outcome, the verdict mix, results per check, retried asks, and run duration p50 and p95. - `forge`: what the forge holds, and the forge process's CPU, memory and descriptors.