Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow defining apm filter_tags to include or exclude traces #798

Merged
merged 2 commits into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,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 @@ -341,6 +347,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 @@ -684,6 +692,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 @@ -713,6 +741,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
Loading