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

Move flags for stripping and scrubbing keys to agent func #31087

Merged
merged 6 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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: 16 additions & 14 deletions pkg/config/setup/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,6 @@ func InitConfig(config pkgconfigmodel.Setup) {
// Defaults to safe YAML methods in base and custom checks.
config.BindEnvAndSetDefault("disable_unsafe_yaml", true)

// Yaml keys which values are stripped from flare
config.BindEnvAndSetDefault("flare_stripped_keys", []string{})
config.BindEnvAndSetDefault("scrubber.additional_keys", []string{})

// flare configs
config.BindEnvAndSetDefault("flare_provider_timeout", 10*time.Second)

Expand Down Expand Up @@ -552,9 +548,6 @@ func InitConfig(config pkgconfigmodel.Setup) {
// Used internally to protect against configurations where metadata endpoints return incorrect values with 200 status codes.
config.BindEnvAndSetDefault("metadata_endpoints_max_hostname_size", 255)

// Duration during which the host tags will be submitted with metrics.
config.BindEnvAndSetDefault("expected_tags_duration", time.Duration(0))

// EC2
config.BindEnvAndSetDefault("ec2_use_windows_prefix_detection", false)
config.BindEnvAndSetDefault("ec2_metadata_timeout", 300) // value in milliseconds
Expand Down Expand Up @@ -676,11 +669,6 @@ func InitConfig(config pkgconfigmodel.Setup) {
config.BindEnvAndSetDefault("checks_tag_cardinality", "low")
config.BindEnvAndSetDefault("dogstatsd_tag_cardinality", "low")

// Autoscaling product
config.BindEnvAndSetDefault("autoscaling.workload.enabled", false)
config.BindEnvAndSetDefault("autoscaling.failover.enabled", false)
config.BindEnv("autoscaling.failover.metrics")

config.BindEnvAndSetDefault("hpa_watcher_polling_freq", 10)
config.BindEnvAndSetDefault("hpa_watcher_gc_period", 60*5) // 5 minutes
config.BindEnvAndSetDefault("hpa_configmap_name", "datadog-custom-metrics")
Expand Down Expand Up @@ -1001,8 +989,6 @@ func InitConfig(config pkgconfigmodel.Setup) {
config.BindEnvAndSetDefault("installer.registry.auth", "")
config.BindEnvAndSetDefault("installer.registry.username", "")
config.BindEnvAndSetDefault("installer.registry.password", "")
config.BindEnv("fleet_policies_dir")
config.SetDefault("fleet_layers", []string{})

// Data Jobs Monitoring config
config.BindEnvAndSetDefault("djm_config.enabled", false)
Expand Down Expand Up @@ -1101,6 +1087,22 @@ func agent(config pkgconfigmodel.Setup) {
// Use to output logs in JSON format
config.BindEnvAndSetDefault("log_format_json", false)

// Yaml keys which values are stripped from flare
config.BindEnvAndSetDefault("flare_stripped_keys", []string{})
config.BindEnvAndSetDefault("scrubber.additional_keys", []string{})

// Duration during which the host tags will be submitted with metrics.
config.BindEnvAndSetDefault("expected_tags_duration", time.Duration(0))

// Directory to store fleet policies
config.BindEnv("fleet_policies_dir")
config.SetDefault("fleet_layers", []string{})

// Autoscaling product
config.BindEnvAndSetDefault("autoscaling.workload.enabled", false)
config.BindEnvAndSetDefault("autoscaling.failover.enabled", false)
config.BindEnv("autoscaling.failover.metrics")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥜 nitpick: ‏Those should probably go in a fleet and autoscaling group, doesn't seem specific to the (core) agent


// Agent GUI access host
// 'http://localhost' is preferred over 'http://127.0.0.1' due to Internet Explorer behavior.
// Internet Explorer High Security Level does not support setting cookies via HTTP Header response.
Expand Down
11 changes: 11 additions & 0 deletions releasenotes/notes/scrub-keys-d8faafcc427013be.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure we need a release note for that honestly (not even sure serverless re-uses those release notes), but up to you

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Each section from every release note are combined when the
# CHANGELOG.rst is rendered. So the text needs to be worded so that
# it does not depend on any information only available in another
# section. This may mean repeating some details, but each section
# must be readable independently of the other.
#
# Each section note must be formatted as reStructuredText.
---
fixes:
- |
The keys flare_stripped_keys and scrubber.additional_keys are defined in a common location so that serverless knows about them, avoiding warning log messages.
Loading