Merge pull request #113370 from chkno/prometheus-systemd-exporter-no-flags

prometheus-systemd-exporter: Init at 0.4.0
This commit is contained in:
WilliButz
2021-03-11 19:18:29 +01:00
committed by GitHub
5 changed files with 61 additions and 0 deletions
@@ -53,6 +53,7 @@ let
"smokeping"
"sql"
"surfboard"
"systemd"
"tor"
"unifi"
"unifi-poller"
@@ -0,0 +1,18 @@
{ config, pkgs, lib, ... }:
with lib;
let cfg = config.services.prometheus.exporters.systemd;
in {
port = 9558;
serviceOpts = {
serviceConfig = {
ExecStart = ''
${pkgs.prometheus-systemd-exporter}/bin/systemd_exporter \
--web.listen-address ${cfg.listenAddress}:${toString cfg.port}
'';
};
};
}
+16
View File
@@ -835,6 +835,22 @@ let
'';
};
systemd = {
exporterConfig = {
enable = true;
};
metricProvider = { };
exporterTest = ''
wait_for_unit("prometheus-systemd-exporter.service")
wait_for_open_port(9558)
succeed(
"curl -sSf localhost:9558/metrics | grep -q '{}'".format(
'systemd_unit_state{name="basic.target",state="active",type="target"} 1'
)
)
'';
};
tor = {
exporterConfig = {
enable = true;