aboutsummaryrefslogtreecommitdiff
path: root/tharos/prometheus.nix
blob: a5011ea7fe77efc7e1ca1d2b5cb8b6abdd0c845a (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
33
34
35
36
37
38
39
40
{ self, lib, ... }:
{
  flake.machines.tharos = {
    nixos =
      { config, ... }:
      {
        services.prometheus = {
          enable = true;
          listenAddress = "127.0.0.1";
          extraFlags = [
            "--query.max-samples=1000000"
            "--query.max-concurrency=2"
            "--query.timeout=10s"
          ];
          exporters.node = {
            enable = true;
            listenAddress = "127.0.0.1";
            enabledCollectors = [ ];
          };
          globalConfig.scrape_interval = "10s";
          scrapeConfigs = [
            {
              job_name = "node";
              static_configs = [
                {
                  targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ];
                }
              ];
            }
          ];
        };
      };

    vm =
      { ... }:
      {
        services.prometheus.globalConfig.scrape_interval = lib.mkForce "5s";
      };
  };
}