-
Notifications
You must be signed in to change notification settings - Fork 15
feat: eat: Add hierarchical configurable compression levels #800
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
814c585
feat: No longer launch Go-based agent for compatibility/OTLP/AAP conf…
litianningdatadog 58f01a0
feat: Add hierarchical configurable compression levels for metrics an…
litianningdatadog 6b6af44
Merge branch 'main' into tianning.li/SVLS-7461
litianningdatadog d161fa8
feat: add configurable compression levels for telemetry data
litianningdatadog bfb7832
Merge branch 'tianning.li/SVLS-7461' of github.com:DataDog/datadog-la…
litianningdatadog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,6 +107,12 @@ pub struct EnvConfig { | |
| /// @env `DD_TAGS` | ||
| #[serde(deserialize_with = "deserialize_key_value_pairs")] | ||
| pub tags: HashMap<String, String>, | ||
| /// @env `DD_COMPRESSION_LEVEL` | ||
| /// | ||
| /// Global level `compression_level` parameter accepts values from 0 (no compression) | ||
litianningdatadog marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /// to 9 (maximum compression but higher resource usage). This value is effective only if | ||
| /// the individual component doesn't specify its own. | ||
| pub compression_level: Option<i32>, | ||
|
|
||
| // Logs | ||
| /// @env `DD_LOGS_CONFIG_LOGS_DD_URL` | ||
|
|
@@ -229,6 +235,12 @@ pub struct EnvConfig { | |
| #[serde(deserialize_with = "deserialize_optional_bool_from_anything")] | ||
| pub trace_propagation_http_baggage_enabled: Option<bool>, | ||
|
|
||
| /// @env `DD_METRICS_CONFIG_COMPRESSION_LEVEL` | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This env var doesn't exist, I cannot see it anywhere in our docs |
||
| /// The metrics compresses traces before sending them. The `compression_level` parameter | ||
| /// accepts values from 0 (no compression) to 9 (maximum compression but | ||
| /// higher resource usage). | ||
| pub metrics_config_compression_level: Option<i32>, | ||
|
|
||
| // OTLP | ||
| // | ||
| // - APM / Traces | ||
|
|
@@ -393,10 +405,18 @@ fn merge_config(config: &mut Config, env_config: &EnvConfig) { | |
| merge_string!(config, env_config, url); | ||
| merge_hashmap!(config, env_config, additional_endpoints); | ||
|
|
||
| merge_option_to_value!(config, env_config, compression_level); | ||
|
|
||
| // Logs | ||
| merge_string!(config, env_config, logs_config_logs_dd_url); | ||
| merge_option!(config, env_config, logs_config_processing_rules); | ||
| merge_option_to_value!(config, env_config, logs_config_use_compression); | ||
| merge_option_to_value!( | ||
| config, | ||
| logs_config_compression_level, | ||
| env_config, | ||
| compression_level | ||
| ); | ||
| merge_option_to_value!(config, env_config, logs_config_compression_level); | ||
| merge_vec!(config, env_config, logs_config_additional_endpoints); | ||
|
|
||
|
|
@@ -414,6 +434,12 @@ fn merge_config(config: &mut Config, env_config: &EnvConfig) { | |
| env_config, | ||
| apm_config_obfuscation_http_remove_paths_with_digits | ||
| ); | ||
| merge_option_to_value!( | ||
| config, | ||
| apm_config_compression_level, | ||
| env_config, | ||
| compression_level | ||
| ); | ||
| merge_option_to_value!(config, env_config, apm_config_compression_level); | ||
| merge_vec!(config, env_config, apm_features); | ||
| merge_hashmap!(config, env_config, apm_additional_endpoints); | ||
|
|
@@ -429,6 +455,15 @@ fn merge_config(config: &mut Config, env_config: &EnvConfig) { | |
| merge_option_to_value!(config, env_config, trace_propagation_extract_first); | ||
| merge_option_to_value!(config, env_config, trace_propagation_http_baggage_enabled); | ||
|
|
||
| // Metrics | ||
| merge_option_to_value!( | ||
| config, | ||
| metrics_config_compression_level, | ||
| env_config, | ||
| compression_level | ||
| ); | ||
| merge_option_to_value!(config, env_config, metrics_config_compression_level); | ||
|
|
||
| // OTLP | ||
| merge_option_to_value!(config, env_config, otlp_config_traces_enabled); | ||
| merge_option_to_value!( | ||
|
|
@@ -588,6 +623,7 @@ mod tests { | |
| jail.set_env("DD_SERVICE", "test-service"); | ||
| jail.set_env("DD_VERSION", "1.0.0"); | ||
| jail.set_env("DD_TAGS", "team:test-team,project:test-project"); | ||
| jail.set_env("DD_COMPRESSION_LEVEL", "4"); | ||
|
|
||
| // Logs | ||
| jail.set_env("DD_LOGS_CONFIG_LOGS_DD_URL", "https://logs.datadoghq.com"); | ||
|
|
@@ -596,7 +632,7 @@ mod tests { | |
| r#"[{"type":"exclude_at_match","name":"exclude","pattern":"exclude"}]"#, | ||
| ); | ||
| jail.set_env("DD_LOGS_CONFIG_USE_COMPRESSION", "false"); | ||
| jail.set_env("DD_LOGS_CONFIG_COMPRESSION_LEVEL", "3"); | ||
| jail.set_env("DD_LOGS_CONFIG_COMPRESSION_LEVEL", "1"); | ||
| jail.set_env( | ||
| "DD_LOGS_CONFIG_ADDITIONAL_ENDPOINTS", | ||
| "[{\"api_key\": \"apikey2\", \"Host\": \"agent-http-intake.logs.datadoghq.com\", \"Port\": 443, \"is_reliable\": true}]", | ||
|
|
@@ -615,7 +651,7 @@ mod tests { | |
| "DD_APM_CONFIG_OBFUSCATION_HTTP_REMOVE_PATHS_WITH_DIGITS", | ||
| "true", | ||
| ); | ||
| jail.set_env("DD_APM_CONFIG_COMPRESSION_LEVEL", "3"); | ||
| jail.set_env("DD_APM_CONFIG_COMPRESSION_LEVEL", "2"); | ||
| jail.set_env( | ||
| "DD_APM_FEATURES", | ||
| "enable_otlp_compute_top_level_by_span_kind,enable_stats_by_span_kind", | ||
|
|
@@ -632,6 +668,7 @@ mod tests { | |
| "env:^test.*$ debug:^true$", | ||
| ); | ||
|
|
||
| jail.set_env("DD_METRICS_CONFIG_COMPRESSION_LEVEL", "3"); | ||
| // Trace Propagation | ||
| jail.set_env("DD_TRACE_PROPAGATION_STYLE", "datadog"); | ||
| jail.set_env("DD_TRACE_PROPAGATION_STYLE_EXTRACT", "b3"); | ||
|
|
@@ -721,6 +758,7 @@ mod tests { | |
| site: "test-site".to_string(), | ||
| api_key: "test-api-key".to_string(), | ||
| log_level: LogLevel::Debug, | ||
| compression_level: 4, | ||
| flush_timeout: 42, | ||
| proxy_https: Some("https://proxy.example.com".to_string()), | ||
| proxy_no_proxy: vec!["localhost".to_string(), "127.0.0.1".to_string()], | ||
|
|
@@ -752,7 +790,7 @@ mod tests { | |
| replace_placeholder: None, | ||
| }]), | ||
| logs_config_use_compression: false, | ||
| logs_config_compression_level: 3, | ||
| logs_config_compression_level: 1, | ||
| logs_config_additional_endpoints: vec![LogsAdditionalEndpoint { | ||
| api_key: "apikey2".to_string(), | ||
| host: "agent-http-intake.logs.datadoghq.com".to_string(), | ||
|
|
@@ -772,7 +810,7 @@ mod tests { | |
| ), | ||
| apm_config_obfuscation_http_remove_query_string: true, | ||
| apm_config_obfuscation_http_remove_paths_with_digits: true, | ||
| apm_config_compression_level: 3, | ||
| apm_config_compression_level: 2, | ||
| apm_features: vec![ | ||
| "enable_otlp_compute_top_level_by_span_kind".to_string(), | ||
| "enable_stats_by_span_kind".to_string(), | ||
|
|
@@ -808,6 +846,7 @@ mod tests { | |
| trace_propagation_extract_first: true, | ||
| trace_propagation_http_baggage_enabled: true, | ||
| trace_aws_service_representation_enabled: true, | ||
| metrics_config_compression_level: 3, | ||
| otlp_config_traces_enabled: false, | ||
| otlp_config_traces_span_name_as_resource_name: true, | ||
| otlp_config_traces_span_name_remappings: HashMap::from([( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also couldn't find this in any docs from the Agent, seems like this only exist in the Lambda Forwarder?