Skip to content

Commit

Permalink
nixos datadog module: add processConfig option
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Apr 19, 2017
1 parent 9db1178 commit c5d4f0d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions nixos/modules/services/monitoring/dd-agent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ let
nginxConfig = pkgs.writeText "nginx.yaml" cfg.nginxConfig;
mongoConfig = pkgs.writeText "mongo.yaml" cfg.mongoConfig;
jmxConfig = pkgs.writeText "jmx.yaml" cfg.jmxConfig;
processConfig = pkgs.writeText "process.yaml" cfg.processConfig;

etcfiles =
[ { source = ddConf;
Expand All @@ -96,6 +97,10 @@ let
{ source = mongoConfig;
target = "dd-agent/conf.d/mongo.yaml";
}) ++
(optional (cfg.processConfig != null)
{ source = processConfig;
target = "dd-agent/conf.d/process.yaml";
}) ++
(optional (cfg.jmxConfig != null)
{ source = jmxConfig;
target = "dd-agent/conf.d/jmx.yaml";
Expand Down Expand Up @@ -153,6 +158,16 @@ in {
type = types.uniq (types.nullOr types.string);
};

processConfig = mkOption {
description = ''
Process integration configuration
See http://docs.datadoghq.com/integrations/process/
'';
default = null;
type = types.uniq (types.nullOr types.string);
};

};

config = mkIf cfg.enable {
Expand All @@ -179,7 +194,7 @@ in {
Restart = "always";
RestartSec = 2;
};
restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig jmxConfig ];
restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig jmxConfig processConfig ];
};

systemd.services.dogstatsd = {
Expand All @@ -195,7 +210,7 @@ in {
Restart = "always";
RestartSec = 2;
};
restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig jmxConfig ];
restartTriggers = [ pkgs.dd-agent ddConf diskConfig networkConfig postgresqlConfig nginxConfig mongoConfig jmxConfig processConfig ];
};

systemd.services.dd-jmxfetch = lib.mkIf (cfg.jmxConfig != null) {
Expand Down

0 comments on commit c5d4f0d

Please sign in to comment.