Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Commit

Permalink
nixos/datadog: Don't recommend dd_url for sites, add proper option
Browse files Browse the repository at this point in the history
Turns out, `dd_url` should only be used in proxy scenarios, not to point
datadog to their EU endpoint - `site` should be used for that.

The `dd_url` setting doesn't affect APM, Logs or Live Process intake
which have their own "*_dd_url" settings.
  • Loading branch information
flokli committed Sep 25, 2020
1 parent a0563de commit 8d52cf5
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions nixos/modules/services/monitoring/datadog-agent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ let
cfg = config.services.datadog-agent;

ddConf = {
dd_url = cfg.ddUrl;
skip_ssl_validation = false;
confd_path = "/etc/datadog-agent/conf.d";
additional_checksd = "/etc/datadog-agent/checks.d";
use_dogstatsd = true;
}
// optionalAttrs (cfg.logLevel != null) { log_level = cfg.logLevel; }
// optionalAttrs (cfg.hostname != null) { inherit (cfg) hostname; }
// optionalAttrs (cfg.ddUrl != null) { dd_url = cfg.ddUrl; }
// optionalAttrs (cfg.site != null) { site = cfg.site; }
// optionalAttrs (cfg.tags != null ) { tags = concatStringsSep ", " cfg.tags; }
// optionalAttrs (cfg.enableLiveProcessCollection) { process_config = { enabled = "true"; }; }
// optionalAttrs (cfg.enableTraceAgent) { apm_config = { enabled = true; }; }
Expand Down Expand Up @@ -79,14 +80,23 @@ in {

ddUrl = mkOption {
description = ''
Custom dd_url to configure the agent with.
Useful when you want to point datadog to another endpoint, either
because you need a proxy to send out data, or because you use their EU
endpoint.
Custom dd_url to configure the agent with. Useful if traffic to datadog
needs to go through a proxy.
Don't use this to point to another datadog site (EU) - use site instead.
'';
default = "https://app.datadoghq.com";
example = "https://app.datadoghq.eu";
type = types.str;
default = null;
example = "http://haproxy.example.com:3834";
type = types.nullOr types.str;
};

site = mkOption {
description = ''
The datadog site to point the agent towards.
Set to datadoghq.eu to point it to their EU site.
'';
default = null;
example = "datadoghq.eu";
type = types.nullOr types.str;
};

tags = mkOption {
Expand Down

0 comments on commit 8d52cf5

Please sign in to comment.