summaryrefslogtreecommitdiff
path: root/hosts/p-body/victoriametrics.nix
blob: dec893ef353a1824e848d16112e8493f3dbc8865 (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
{config, ...}: let
  mkScrapes = let
    mkConfig = client: {
      job_name = "${client}";
      static_configs = [
        {
          targets = [
            "${client}:${toString config.services.prometheus.exporters.node.port}"
          ];
        }
      ];
    };
  in
    builtins.map mkConfig;
in {
  services = {
    victoriametrics.enable = true;

    vmagent = {
      enable = true;
      prometheusConfig = {
        scrape_configs = mkScrapes ["p-body" "atlas"];
      };
    };
  };
}