Skip to content

Commit

Permalink
Allow defining apm filter_tags to include or exclude traces (#798)
Browse files Browse the repository at this point in the history
* Allow defining apm filter_tags to include or exclude traces based on filters

* Allow defining filter_tags_regex as well
  • Loading branch information
erik-frontify authored Feb 19, 2024
1 parent a8edfdc commit 2765f3e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@
# $apm_obfuscation
# Hash defining obfuscation rules for sensitive data. (Agent 6 and 7 only).
# Optional Hash. Default: undef
# $apm_filter_tags
# Hash defining filter rules for traces. (Agent 6 and 7 only).
# Optional Hash. Default: undef
# $apm_filter_tags_regex
# Hash defining regex filter rules for traces. (Agent 6 and 7 only).
# Optional Hash. Default: undef
# $process_enabled
# String to enable the process/container agent
# Boolean. Default: false
Expand Down Expand Up @@ -338,6 +344,8 @@
Boolean $apm_non_local_traffic = false,
Optional[Hash[String, Float[0, 1]]] $apm_analyzed_spans = undef,
Optional[Hash[String, Data]] $apm_obfuscation = undef,
Optional[Hash[String, Data]] $apm_filter_tags = undef,
Optional[Hash[String, Data]] $apm_filter_tags_regex = undef,
Boolean $process_enabled = $datadog_agent::params::process_default_enabled,
Boolean $scrub_args = $datadog_agent::params::process_default_scrub_args,
Array $custom_sensitive_words = $datadog_agent::params::process_default_custom_words,
Expand Down Expand Up @@ -681,6 +689,26 @@
$apm_obfuscation_config = {}
}

if $apm_filter_tags {
$apm_filter_tags_config = {
'apm_config' => {
'filter_tags' => $apm_filter_tags
}
}
} else {
$apm_filter_tags_config = {}
}

if $apm_filter_tags_regex {
$apm_filter_tags_regex_config = {
'apm_config' => {
'filter_tags_regex' => $apm_filter_tags_regex
}
}
} else {
$apm_filter_tags_regex_config = {}
}

if $statsd_forward_host.empty {
$statsd_forward_config = {}
} else {
Expand Down Expand Up @@ -710,6 +738,8 @@
$agent_extra_options,
$apm_analyzed_span_config,
$apm_obfuscation_config,
$apm_filter_tags_config,
$apm_filter_tags_regex_config,
$statsd_forward_config,
$host_config,
$additional_checksd_config)
Expand Down

0 comments on commit 2765f3e

Please sign in to comment.