summaryrefslogtreecommitdiff
path: root/hosts/p-body/prometheus.nix
blob: 26e9d0e74241dc4d8004ba6c10b3fdf3e3d31690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{config, ...}: let
  scrapeExporter = name: host: port: {
    job_name = "${name}";
    static_configs = [
      {
        targets = [
          "${host}:${port}"
        ];
      }
    ];
  };
in {
  services.prometheus = {
    enable = true;
    exporters = {
      node = {
        enable = true;
        enabledCollectors = ["systemd"];
      };
    };
    scrapeConfigs = [
      (scrapeExporter "p-body" "localhost" "${toString config.services.prometheus.exporters.node.port}")
      (scrapeExporter "atlas" "atlas" "${toString config.services.prometheus.exporters.node.port}")
    ];
  };

  getchoo.server.services.promtail.clients = [
    {
      url = "http://localhost:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
    }
  ];
}