WIP: Add metrics

This commit is contained in:
Tristan Daniël Maat 2023-10-07 22:14:43 +02:00
parent 8dc5e13363
commit 8dfdaa899f
Signed by: tlater
GPG key ID: 49670FD774E43268
22 changed files with 479 additions and 26 deletions

View file

@ -0,0 +1,31 @@
{config, ...}: {
services.victoriametrics = let
scrapeConfigFromExporters = conf: conf // {inherit (config.services.prometheus.exporters.${conf.name}) listenAddress port;};
scrapeConfigFromLocalExporters = conf: conf // {inherit (config.services.prometheus.local-exporters.${conf.name}) listenAddress port;};
in {
enable = true;
vmagent-scraping.static_configs =
[
{
name = "gitea";
listenAddress = "127.0.0.1";
port = 3000;
}
{
name = "coturn";
listenAddress = "127.0.0.1";
port = 9641;
}
]
++ (map scrapeConfigFromLocalExporters [
{name = "prometheus-fail2ban-exporter";}
])
++ (map scrapeConfigFromExporters [
{name = "domain";}
{name = "node";}
{name = "nginx";}
{name = "nginxlog";}
{name = "systemd";}
]);
};
}