diff options
Diffstat (limited to 'nixos/modules/services/monitoring/datadog-agent.nix')
-rw-r--r-- | nixos/modules/services/monitoring/datadog-agent.nix | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/nixos/modules/services/monitoring/datadog-agent.nix b/nixos/modules/services/monitoring/datadog-agent.nix index 35c08f5e7e303..a4d29d45bacf7 100644 --- a/nixos/modules/services/monitoring/datadog-agent.nix +++ b/nixos/modules/services/monitoring/datadog-agent.nix @@ -7,7 +7,7 @@ let ddConf = { dd_url = "https://app.datadoghq.com"; - skip_ssl_validation = "no"; + skip_ssl_validation = false; confd_path = "/etc/datadog-agent/conf.d"; additional_checksd = "/etc/datadog-agent/checks.d"; use_dogstatsd = true; @@ -16,6 +16,7 @@ let // optionalAttrs (cfg.hostname != null) { inherit (cfg) hostname; } // optionalAttrs (cfg.tags != null ) { tags = concatStringsSep ", " cfg.tags; } // optionalAttrs (cfg.enableLiveProcessCollection) { process_config = { enabled = "true"; }; } + // optionalAttrs (cfg.enableTraceAgent) { apm_config = { enabled = true; }; } // cfg.extraConfig; # Generate Datadog configuration files for each configured checks. @@ -132,6 +133,15 @@ in { default = false; type = types.bool; }; + + enableTraceAgent = mkOption { + description = '' + Whether to enable the trace agent. + ''; + default = false; + type = types.bool; + }; + checks = mkOption { description = '' Configuration for all Datadog checks. Keys of this attribute @@ -176,7 +186,7 @@ in { type = types.attrs; default = { init_config = {}; - instances = [ { use-mount = "no"; } ]; + instances = [ { use_mount = "false"; } ]; }; }; @@ -213,7 +223,6 @@ in { Group = "datadog"; Restart = "always"; RestartSec = 2; - PrivateTmp = true; }; restartTriggers = [ datadogPkg ] ++ map (etc: etc.source) etcfiles; } attrs; @@ -245,6 +254,16 @@ in { ${pkgs.datadog-process-agent}/bin/agent --config /etc/datadog-agent/datadog.yaml ''; }); + + datadog-trace-agent = lib.mkIf cfg.enableTraceAgent (makeService { + description = "Datadog Trace Agent"; + path = [ ]; + script = '' + export DD_API_KEY=$(head -n 1 ${cfg.apiKeyFile}) + ${pkgs.datadog-trace-agent}/bin/trace-agent -config /etc/datadog-agent/datadog.yaml + ''; + }); + }; environment.etc = etcfiles; |