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:
parent
1c3b5e52cf
commit
e9321297c0
1 changed files with 1022 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue