Watch
0
0
Fork
You've already forked hyperhive
0

swarm-grafana: the bao dashboard reads openbao's journal

The bao board was nine metrics panels, so a gap in log delivery looked like
a quiet bao. Three panels read the log store for openbao.service: lines
delivered over time, WARN and ERROR lines over time, and the recent WARN and
ERROR lines themselves. A module-eval case pins them by query.
This commit is contained in:
iris 2026-10-28 18:01:10 +01:00 • committed by mara
commit ae2ecab9f2

View file

@ -691,6 +691,25 @@ let
&& builtins.length selectors == 12
&& lib.all (e: lib.hasInfix "\"service.name\"=\"${stamped.value}\"" e) selectors;
}
{
# The bao board's metrics panels can show a gap in the metrics, never a
# gap in the logs: "bao is quiet" and "bao's logs are not arriving" look
# the same there. These panels read the journal itself. Asserted on the
# query, as for the logs board, because a panel that keeps its title and
# loses its expression renders an empty graph.
name = "the bao dashboard reads openbao's journal from the log store";
ok =
let
board = builtins.fromJSON (builtins.readFile ../host-modules/swarm-grafana/dashboards/bao.json);
logPanels = lib.filter (
p: (p.datasource.type or "") == "victoriametrics-logs-datasource"
) board.panels;
exprs = lib.concatMap (p: map (t: t.expr or "") (p.targets or [ ])) logPanels;
in
builtins.length logPanels == 3
&& lib.all (e: lib.hasInfix "_SYSTEMD_UNIT:\"openbao.service\"" e) exprs
&& lib.any (p: p.type == "logs") logPanels;
}
{
# A module declares its vhost under `gateway.vhosts` and the gateway adds
# what it owns: the listen set, the cert for the name and the security