Watch
0
0
Fork
You've already forked hyperhive
0

swarm-grafana: a host dashboard for the collector's system metrics

Adds host.json (hive and host filters over the hostmetrics series),
registers it in the provisioned dashboard list, lists it in the swarm
services handbook, and adds a module-eval case that it ships and every
query filters on both variables.
This commit is contained in:
atlas 2026-11-08 02:29:16 +01:00 • committed by mara
commit e9321297c0

View file

@ -624,6 +624,23 @@ let
]
) tables;
}
{
# The host board ships, and every query filters on both template
# variables: a panel missing one shows another hive's or host's numbers
# under this selection.
name = "the host dashboard ships, and every panel query filters on hive and host";
ok =
let
provider = lib.head grafanaWithAuthelia.containers.swarm-grafana.config.services.grafana.provision.dashboards.settings.providers;
shipped = lib.attrNames provider.options.path.entries;
board = builtins.fromJSON (builtins.readFile ../host-modules/swarm-grafana/dashboards/host.json);
exprs = lib.concatMap (p: map (t: t.expr) p.targets) board.panels;
in
lib.elem "host.json" shipped
&& lib.length exprs > 0
&& lib.all (e: lib.hasInfix "hive=~\"$hive\"" e && lib.hasInfix "\"host.name\"=~\"$host\"" e) exprs
&& lib.any (e: lib.hasInfix "system.cpu.time" e) exprs;
}
{
# The egress board ships, and its queries read the two squid log lines as
# squid writes them: the would_deny line's field layout, and the default