File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 398398 order => ' 05' ,
399399 }
400400
401+ concat::fragment { 'datadog apm footer' :
402+ target => ' /etc/dd-agent/datadog.conf' ,
403+ content => template (' datadog_agent/datadog_apm_footer.conf.erb' ),
404+ order => ' 06' ,
405+ }
406+
401407
402408 if $puppet_run_reports {
403409 class { 'datadog_agent::reports' :
Original file line number Diff line number Diff line change 206206 end
207207
208208 context 'for APM' do
209- it { should contain_file ( '/etc/dd-agent/ datadog.conf ') . with (
209+ it { should contain_concat__fragment ( ' datadog footer ') . with (
210210 'content' => /^apm_enabled: false\n / ,
211211 ) }
212212 end
509509 end
510510 context 'with apm_enabled set to true' do
511511 let ( :params ) { { :apm_enabled => true } }
512- it { should contain_file ( '/etc/dd-agent/ datadog.conf ') . with (
512+ it { should contain_concat__fragment ( ' datadog footer ') . with (
513513 'content' => /^apm_enabled: true\n / ,
514514 ) }
515515 end
518518 { :apm_enabled => true ,
519519 :apm_env => 'foo' ,
520520 } }
521- it { should contain_file ( '/etc/dd-agent/ datadog.conf ') . with (
521+ it { should contain_concat__fragment ( ' datadog footer ') . with (
522522 'content' => /^apm_enabled: true\n / ,
523523 ) }
524- it { should contain_file ( '/etc/dd-agent/ datadog.conf ') . with (
524+ it { should contain_concat__fragment ( ' datadog apm footer ') . with (
525525 'content' => /^\[ trace.agent\] \n / ,
526526 ) }
527- it { should contain_file ( '/etc/dd-agent/ datadog.conf ') . with (
527+ it { should contain_concat__fragment ( ' datadog apm footer ') . with (
528528 'content' => /^env: foo\n / ,
529529 ) }
530530 end
Original file line number Diff line number Diff line change @@ -433,8 +433,3 @@ apm_enabled: <%= @apm_enabled %>
433433# ========================================================================== #
434434
435435<% end -%>
436-
437- <% if not @apm_env.empty? -%>
438- [trace.agent]
439- env: <%= @apm_env %>
440- <% end -%>
Original file line number Diff line number Diff line change 1+ <% if not @apm_env.empty? -%>
2+ [trace.agent]
3+ env: <%= @apm_env %>
4+ <% end -%>
Original file line number Diff line number Diff line change @@ -343,6 +343,14 @@ sd_jmx_enable: <%= @sd_jmx_enable %>
343343consul_token: <%= @consul_token %>
344344<% end -%>
345345
346+ # ========================================================================== #
347+ # Trace #
348+ # ========================================================================== #
349+
350+ # Enable the trace agent.
351+ apm_enabled: <%= @apm_enabled %>
352+
353+
346354<% if not @extra_template.empty? -%>
347355# ========================================================================== #
348356# Custom Templates from Puppet #
You can’t perform that action at this time.
0 commit comments