[datadog.conf] Fix `Main` section when `enable_trace_agent` is true
MODIFY
templates/default/datadog.conf.erb
templates/default/datadog.conf.erb
@@ -61,19 +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'] %>
-<% end -%>
-
<% if node['datadog']['dogstatsd'] -%>
# ========================================================================== #
# DogStatsd configuration #
@@ -164,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 -%>

[datadog.conf] Fix `Main` section when `enable_trace_agent` is true (#419)