1
Fork 0

Set up prometheus nginx exporter

This commit is contained in:
prescientmoon 2024-02-24 10:21:11 +01:00
parent 5a011e76d4
commit 271e43040c
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4
2 changed files with 12 additions and 2 deletions

View file

@ -6,5 +6,6 @@
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
statusPage = true; # Necessary for prometheus exporter
};
}

View file

@ -10,19 +10,28 @@ in
port = 8410;
webExternalUrl = "https://${host}";
# {{{ Node exporter (system info)
# {{{ Base exporters
exporters = {
# System info
node = {
enable = true;
enabledCollectors = [ "systemd" ];
port = 8411;
};
nginx = {
enable = true;
port = 8412;
};
};
scrapeConfigs = [{
job_name = "lapetus";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" ];
targets = [
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
"127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}"
];
}];
}];
# }}}