mirror of
https://git.sr.ht/~rouven/nixos-config
synced 2025-04-26 08:28:31 +02:00
add grafana and prometheus
This commit is contained in:
parent
78b1a5761c
commit
862e8ecfb2
8 changed files with 94 additions and 20 deletions
35
hosts/nuc/modules/prometheus/default.nix
Normal file
35
hosts/nuc/modules/prometheus/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
exportersConfig = config.services.prometheus.exporters;
|
||||
in
|
||||
{
|
||||
services.prometheus = {
|
||||
enable = true;
|
||||
exporters = {
|
||||
node = {
|
||||
enable = true;
|
||||
enabledCollectors = [ "systemd" ];
|
||||
};
|
||||
postgres.enable = true;
|
||||
};
|
||||
scrapeConfigs = [
|
||||
{
|
||||
job_name = "node";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "127.0.0.1:${toString exportersConfig.node.port}" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
job_name = "postgres";
|
||||
static_configs = [
|
||||
{
|
||||
targets = [ "127.0.0.1:${toString exportersConfig.postgres.port}" ];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue