From de98da5fd492a49b719e5f0f91c55dc161bea1a6 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 28 Mar 2017 11:47:04 -0400 Subject: [PATCH 1/2] Add [Main] section header to end of datadog.conf enable_trace_agent template conditional --- templates/default/datadog.conf.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/default/datadog.conf.erb b/templates/default/datadog.conf.erb index 12490ba9..4d48e670 100644 --- a/templates/default/datadog.conf.erb +++ b/templates/default/datadog.conf.erb @@ -72,6 +72,8 @@ max_traces_per_second: <%= node['datadog']['max_traces_per_second'] %> [trace.receiver] receiver_port: <%= node['datadog']['receiver_port'] %> connection_limit: <%= node['datadog']['connection_limit'] %> + +[Main] <% end -%> <% if node['datadog']['dogstatsd'] -%> From adc912563107d602528c303866ba791c00745e19 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 28 Mar 2017 14:37:59 -0400 Subject: [PATCH 2/2] Move datadog.conf trace agent settings to bottom of file --- templates/default/datadog.conf.erb | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/templates/default/datadog.conf.erb b/templates/default/datadog.conf.erb index 4d48e670..375f8deb 100644 --- a/templates/default/datadog.conf.erb +++ b/templates/default/datadog.conf.erb @@ -61,21 +61,6 @@ graphite_listen_port: <%= node['datadog']['graphite_port'] %> histogram_aggregates: <%= node['datadog']['histogram_aggregates'] %> histogram_percentiles: <%= node['datadog']['histogram_percentiles'] %> -<% if node['datadog']['enable_trace_agent'] == true -%> -## Trace settings -apm_enabled: true - -[trace.sampler] -extra_sample_rate: <%= node['datadog']['extra_sample_rate'] %> -max_traces_per_second: <%= node['datadog']['max_traces_per_second'] %> - -[trace.receiver] -receiver_port: <%= node['datadog']['receiver_port'] %> -connection_limit: <%= node['datadog']['connection_limit'] %> - -[Main] -<% end -%> - <% if node['datadog']['dogstatsd'] -%> # ========================================================================== # # DogStatsd configuration # @@ -166,3 +151,16 @@ end <% end -%> <% end -%> <% end -%> + +<% if node['datadog']['enable_trace_agent'] == true -%> +## Trace settings +apm_enabled: true + +[trace.sampler] +extra_sample_rate: <%= node['datadog']['extra_sample_rate'] %> +max_traces_per_second: <%= node['datadog']['max_traces_per_second'] %> + +[trace.receiver] +receiver_port: <%= node['datadog']['receiver_port'] %> +connection_limit: <%= node['datadog']['connection_limit'] %> +<% end -%>