Skip to content

Commit 2765f3e

Browse files
Allow defining apm filter_tags to include or exclude traces (#798)
* Allow defining apm filter_tags to include or exclude traces based on filters * Allow defining filter_tags_regex as well
1 parent a8edfdc commit 2765f3e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

manifests/init.pp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@
189189
# $apm_obfuscation
190190
# Hash defining obfuscation rules for sensitive data. (Agent 6 and 7 only).
191191
# Optional Hash. Default: undef
192+
# $apm_filter_tags
193+
# Hash defining filter rules for traces. (Agent 6 and 7 only).
194+
# Optional Hash. Default: undef
195+
# $apm_filter_tags_regex
196+
# Hash defining regex filter rules for traces. (Agent 6 and 7 only).
197+
# Optional Hash. Default: undef
192198
# $process_enabled
193199
# String to enable the process/container agent
194200
# Boolean. Default: false
@@ -338,6 +344,8 @@
338344
Boolean $apm_non_local_traffic = false,
339345
Optional[Hash[String, Float[0, 1]]] $apm_analyzed_spans = undef,
340346
Optional[Hash[String, Data]] $apm_obfuscation = undef,
347+
Optional[Hash[String, Data]] $apm_filter_tags = undef,
348+
Optional[Hash[String, Data]] $apm_filter_tags_regex = undef,
341349
Boolean $process_enabled = $datadog_agent::params::process_default_enabled,
342350
Boolean $scrub_args = $datadog_agent::params::process_default_scrub_args,
343351
Array $custom_sensitive_words = $datadog_agent::params::process_default_custom_words,
@@ -681,6 +689,26 @@
681689
$apm_obfuscation_config = {}
682690
}
683691

692+
if $apm_filter_tags {
693+
$apm_filter_tags_config = {
694+
'apm_config' => {
695+
'filter_tags' => $apm_filter_tags
696+
}
697+
}
698+
} else {
699+
$apm_filter_tags_config = {}
700+
}
701+
702+
if $apm_filter_tags_regex {
703+
$apm_filter_tags_regex_config = {
704+
'apm_config' => {
705+
'filter_tags_regex' => $apm_filter_tags_regex
706+
}
707+
}
708+
} else {
709+
$apm_filter_tags_regex_config = {}
710+
}
711+
684712
if $statsd_forward_host.empty {
685713
$statsd_forward_config = {}
686714
} else {
@@ -710,6 +738,8 @@
710738
$agent_extra_options,
711739
$apm_analyzed_span_config,
712740
$apm_obfuscation_config,
741+
$apm_filter_tags_config,
742+
$apm_filter_tags_regex_config,
713743
$statsd_forward_config,
714744
$host_config,
715745
$additional_checksd_config)

0 commit comments

Comments
 (0)