wynne: enable postgresql_exporter
This commit is contained in:
parent
36ed3c73b5
commit
c43ccffcb8
2 changed files with 13 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
{ config, ... }: {
|
||||
{ lib, config, ... }: {
|
||||
services = {
|
||||
caddy = {
|
||||
virtualHosts."${config.networking.hostName}.labs.adtya.xyz" = {
|
||||
|
@ -10,6 +10,12 @@
|
|||
uri replace /systemd-metrics /metrics
|
||||
reverse_proxy 127.0.0.1:9558
|
||||
}
|
||||
${lib.optionalString config.services.prometheus.exporters.postgres.enable ''
|
||||
handle /postgres-metrics {
|
||||
uri replace /postgres-metrics /metrics
|
||||
reverse_proxy ${config.services.prometheus.exporters.postgres.listenAddress}:${toString config.services.prometheus.exporters.postgres.port}
|
||||
}
|
||||
''}
|
||||
tls /persist/secrets/caddy/certs/default.crt /persist/secrets/caddy/certs/default.key
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
{ config, pkgs, ... }: {
|
||||
services = {
|
||||
prometheus.exporters.postgres = {
|
||||
enable = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
port = 9187;
|
||||
runAsLocalSuperUser = true;
|
||||
};
|
||||
postgresql = {
|
||||
enable = true;
|
||||
dataDir = "/mnt/data/postgresql/${config.services.postgresql.package.psqlSchema}";
|
||||
|
|
Loading…
Reference in a new issue