feat: enable postgres exporter, group monitoring programs

This commit is contained in:
Ivan R. 2024-03-11 22:05:46 +05:00
parent 543b6153bf
commit 0bcd6def8c
No known key found for this signature in database
GPG key ID: 56C7BAAE859B302C
4 changed files with 19 additions and 2 deletions

View file

@ -29,8 +29,8 @@
./programs/prosody.nix
./programs/yggdrasil.nix
./programs/grafana.nix
./programs/prometheus.nix
./monitoring/grafana.nix
./monitoring/prometheus.nix
];
nix = {

View file

@ -13,6 +13,7 @@
"freshrss"
"prosody"
"grafana"
"postgres-exporter"
];
ensureUsers = [
{
@ -60,6 +61,11 @@
ensureDBOwnership = true;
ensureClauses.login = true;
}
{
name = "postgres-exporter";
ensureDBOwnership = true;
ensureClauses.login = true;
}
];
identMap = ''
# ArbitraryMapName systemUser DBUser

View file

@ -9,6 +9,11 @@
enabledCollectors = [ "systemd" ];
port = 55012;
};
postgres = {
enable = true;
port = 55014;
dataSourceName = "user=postgres-exporter database=postgres-exporter host=/run/postgresql sslmode=disable";
};
};
scrapeConfigs = [
@ -25,6 +30,12 @@
targets = [ "127.0.0.1:55013" ];
}];
}
{
job_name = "postgres";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.postgres.port}" ];
}];
}
];
};
}