about summary refs log tree commit diff
path: root/nixos/modules/services/monitoring/prometheus/exporters/redis.nix
blob: 672e3dfe7b059df4170e30afae0bfc9e55011d19 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{ config, lib, pkgs, options, ... }:

let
  cfg = config.services.prometheus.exporters.redis;
  inherit (lib) concatStringsSep;
in
{
  port = 9121;
  serviceOpts = {
    serviceConfig = {
      RestrictAddressFamilies = [ "AF_UNIX" ];
      ExecStart = ''
        ${pkgs.prometheus-redis-exporter}/bin/redis_exporter \
          -web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
          ${concatStringsSep " \\\n  " cfg.extraFlags}
      '';
    };
  };
}