Skip to content

Commit

Permalink
nixos datadog module: add processConfig option
Browse files Browse the repository at this point in the history
(cherry picked from commit 0bc0331)
Signed-off-by: Domen Kožar <domen@dev.si>
  • Loading branch information
domenkozar committed May 4, 2017
1 parent 77c85b0 commit a983b62
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions nixos/modules/services/monitoring/dd-agent/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 =
let
Expand Down Expand Up @@ -101,6 +102,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 @@ -158,6 +163,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 @@ -184,7 +199,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 @@ -200,7 +215,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 a983b62

Please sign in to comment.