mirror of
https://github.com/ordinary-dev/nixos-config.git
synced 2024-09-19 19:30:28 +05:00
feat: enable postgres exporter, group monitoring programs
This commit is contained in:
parent
543b6153bf
commit
0bcd6def8c
|
@ -29,8 +29,8 @@
|
|||
./programs/prosody.nix
|
||||
./programs/yggdrasil.nix
|
||||
|
||||
./programs/grafana.nix
|
||||
./programs/prometheus.nix
|
||||
./monitoring/grafana.nix
|
||||
./monitoring/prometheus.nix
|
||||
];
|
||||
|
||||
nix = {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}" ];
|
||||
}];
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue