nixos/tests/prometheus-exporters: add unbound test
Author: WilliButz <willibutz@posteo.de>
This commit is contained in:
parent
ba13dc0652
commit
da858b16b8
|
@ -1000,6 +1000,29 @@ let
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
unbound = {
|
||||||
|
exporterConfig = {
|
||||||
|
enable = true;
|
||||||
|
fetchType = "uds";
|
||||||
|
controlInterface = "/run/unbound/unbound.ctl";
|
||||||
|
};
|
||||||
|
metricProvider = {
|
||||||
|
services.unbound = {
|
||||||
|
enable = true;
|
||||||
|
localControlSocketPath = "/run/unbound/unbound.ctl";
|
||||||
|
};
|
||||||
|
systemd.services.prometheus-unbound-exporter.serviceConfig = {
|
||||||
|
SupplementaryGroups = [ "unbound" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
exporterTest = ''
|
||||||
|
wait_for_unit("unbound.service")
|
||||||
|
wait_for_unit("prometheus-unbound-exporter.service")
|
||||||
|
wait_for_open_port(9167)
|
||||||
|
succeed("curl -sSf localhost:9167/metrics | grep -q 'unbound_up 1'")
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
varnish = {
|
varnish = {
|
||||||
exporterConfig = {
|
exporterConfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, rustPlatform, fetchFromGitHub, openssl, pkg-config }:
|
{ lib, rustPlatform, fetchFromGitHub, openssl, pkg-config, nixosTests }:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "unbound-telemetry";
|
pname = "unbound-telemetry";
|
||||||
|
@ -17,6 +17,10 @@ rustPlatform.buildRustPackage rec {
|
||||||
|
|
||||||
buildInputs = [ openssl ];
|
buildInputs = [ openssl ];
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
inherit (nixosTests.prometheus-exporters) unbound;
|
||||||
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Prometheus exporter for Unbound DNS resolver";
|
description = "Prometheus exporter for Unbound DNS resolver";
|
||||||
homepage = "https://github.com/svartalf/unbound-telemetry";
|
homepage = "https://github.com/svartalf/unbound-telemetry";
|
||||||
|
|
Loading…
Reference in New Issue