diff --git a/instances/loki/configuration.nix b/instances/loki/configuration.nix index 8dfc7e2..9f42f4f 100644 --- a/instances/loki/configuration.nix +++ b/instances/loki/configuration.nix @@ -470,25 +470,25 @@ in ]; }; - servies.prometheus = { + services.prometheus = { enable = true; - # exporters = { - # node = { enable = true; enabledCollectors = [ "systemd" ]; }; - # process = { - # enable = true; - # settings.process_names = [ - # # Remove nix store path from process name - # { name = "{{.Matches.Wrapped}} {{ .Matches.Args }}"; cmdline = [ "^/nix/store[^ ]*/(?P[^ /]*) (?P.*)" ]; } - # ]; - # }; - # systemd.enable = true; - # }; - # globalConfig = { scrape_interval = "10s"; }; - # scrapeConfigs = [ - # { job_name = "node"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }]; } - # { job_name = "process"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.process.port}" ]; }]; } - # { job_name = "systemd"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.systemd.port}" ]; }]; } - # ]; + exporters = { + node = { enable = true; enabledCollectors = [ "systemd" ]; }; + process = { + enable = true; + settings.process_names = [ + # Remove nix store path from process name + { name = "{{.Matches.Wrapped}} {{ .Matches.Args }}"; cmdline = [ "^/nix/store[^ ]*/(?P[^ /]*) (?P.*)" ]; } + ]; + }; + systemd.enable = true; + }; + globalConfig = { scrape_interval = "10s"; }; + scrapeConfigs = [ + { job_name = "node"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }]; } + { job_name = "process"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.process.port}" ]; }]; } + { job_name = "systemd"; static_configs = [{ targets = [ "localhost:${toString config.services.prometheus.exporters.systemd.port}" ]; }]; } + ]; retentionTime = "15d"; };