From 38adc0f648cc4036969573f02049eb917c4ae70d Mon Sep 17 00:00:00 2001 From: Erik Geiger Date: Thu, 1 Feb 2024 12:18:18 +0100 Subject: [PATCH 1/2] Allow defining apm filter_tags to include or exclude traces based on filters --- manifests/init.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index d52a9111..579cea16 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -192,6 +192,9 @@ # $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 # $process_enabled # String to enable the process/container agent # Boolean. Default: false @@ -341,6 +344,7 @@ 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, 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, @@ -684,6 +688,16 @@ $apm_obfuscation_config = {} } + if $apm_filter_tags { + $apm_filter_tags_config = { + 'apm_config' => { + 'filter_tags' => $apm_filter_tags + } + } + } else { + $apm_filter_tags_config = {} + } + if $statsd_forward_host.empty { $statsd_forward_config = {} } else { @@ -713,6 +727,7 @@ $agent_extra_options, $apm_analyzed_span_config, $apm_obfuscation_config, + $apm_filter_tags_config, $statsd_forward_config, $host_config, $additional_checksd_config) From 962c24fd7acf1016577fad51d5c8ad05793a2eac Mon Sep 17 00:00:00 2001 From: Erik Geiger Date: Fri, 2 Feb 2024 16:10:31 +0100 Subject: [PATCH 2/2] Allow defining filter_tags_regex as well --- manifests/init.pp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 579cea16..4c095988 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -195,6 +195,9 @@ # $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 @@ -345,6 +348,7 @@ 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, @@ -698,6 +702,16 @@ $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 { @@ -728,6 +742,7 @@ $apm_analyzed_span_config, $apm_obfuscation_config, $apm_filter_tags_config, + $apm_filter_tags_regex_config, $statsd_forward_config, $host_config, $additional_checksd_config)