Skip to content

Conversation

litianningdatadog
Copy link
Contributor

@litianningdatadog litianningdatadog commented Aug 25, 2025

feat: Add hierarchical configurable compression levels

  • Add global compression_level config parameter (0-9, default: 6) with fallback hierarchy
  • Support 2-level compression configuration: global level first, then module-specific
  • This makes configuration more convenient - set once globally or override per module
  • Apply compression configuration to metrics flushers and trace processor
  • Add environment variable DD_COMPRESSION_LEVEL for global setting

Test

  • Configuration:
image - ([log](https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Flambda$252Fltn1-fullinstrument-bn-cold-python310-lambda/log-events/2025$252F08$252F25$252F$255B$2524LATEST$255D9c19719435bc48839f6f005d2b58b552)) Configuration: image

///
/// Global level `compression_level` parameter accepts values from 0 (no compression)
/// to 9 (maximum compression but higher resource usage). Only takes effect if
/// `use_compression` is set to `true`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we requiring 'use_compression' if the user specifies 'compression_level'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this confusing and incorrect comment line.

Copy link
Contributor

Choose a reason for hiding this comment

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

This was a config in the (old) Go agent, but now that we have a global compression config this could be removed?

@jchrostek-dd
Copy link
Contributor

Do we have a fast-follow task to update our public docs for this?

@litianningdatadog
Copy link
Contributor Author

Do we have a fast-follow task to update our public docs for this?
Not what I am aware of. Posted the question here. Maybe we can formalize this.

@litianningdatadog litianningdatadog marked this pull request as ready for review August 29, 2025 19:17
@litianningdatadog litianningdatadog requested a review from a team as a code owner August 29, 2025 19:17
@litianningdatadog litianningdatadog marked this pull request as draft August 29, 2025 19:18
@litianningdatadog litianningdatadog marked this pull request as ready for review September 2, 2025 17:49
…ig (#788)

https://datadoghq.atlassian.net/browse/SVLS-7398

- As part of coming release, bottlecap agent no longer launches Go-based
agent when compatibility/AAP/OTLP features are active
- Emit the same metric when detecting any of above configuration
- Update corresponding unit tests

Manifests:
- [Test lambda
function](https://us-east-1.console.aws.amazon.com/lambda/home?region=us-east-1#/functions/ltn1-fullinstrument-bn-cold-python310-lambda?code=&subtab=envVars&tab=testing)
with
[logs](https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logsV2:log-groups/log-group/$252Faws$252Flambda$252Fltn1-fullinstrument-bn-cold-python310-lambda/log-events/2025$252F08$252F21$252F$255B$2524LATEST$255Df3788d359677452dad162488ff15456f$3FfilterPattern$3Dotel)
showing compatibility/AAP/OTPL are enabled
<img width="2260" height="454" alt="image"
src="https://github.com/user-attachments/assets/5dfd4954-5191-4390-83f5-a8eb3bffb9d3"
/>

-
[Logging](https://app.datadoghq.com/logs/livetail?query=functionname%3Altn1-fullinstrument-bn-cold-python310-lambda%20Metric&agg_m=count&agg_m_source=base&agg_t=count&cols=host%2Cservice&fromUser=true&messageDisplay=inline&refresh_mode=paused&storage=driveline&stream_sort=desc&viz=stream&from_ts=1755787655569&to_ts=1755787689060&live=false)
<img width="1058" height="911" alt="image"
src="https://github.com/user-attachments/assets/629f75d1-e115-4478-afac-ad16d9369fa7"
/>

-
[Metric](https://app.datadoghq.com/screen/integration/aws_lambda_enhanced_metrics?fromUser=false&fullscreen_end_ts=1755788220000&fullscreen_paused=true&fullscreen_refresh_mode=paused&fullscreen_section=overview&fullscreen_start_ts=1755787200000&fullscreen_widget=2&graph-explorer__tile_def=N4IgbglgXiBcIBcD2AHANhAzgkAaEAxgK7ZIC2A%2BhgHYDWmcA2gLr4BOApgI5EfYOxGoTphRJqmDhQBmSNmQCGOeJgIK0CtnhA8ObCHyagAJkoUVMSImwIc4IMhwT6CDfNQWP7utgE8AjNo%2BvvaYRGSwpggKxkgA5gB0kmxgemh8mAkcAB4IHBIQ4gnSChBoSKlswAAkCgDumBQKBARW1Ai41ZxxhdSd0kTUBAi9AL4ABABGvuPAA0Mj4h6OowkKja2DCAAUAJTaCnFx3UpyoeEgo6wgsvJEGgJCN3Jk9wrevH6BV-iWbMqgTbtOAAJgADPg5MY9BRpkZEL4UHZ4LdXhptBBqNDsnAISAoXp7NDVJdmKMfiBsL50nBgOSgA&refresh_mode=sliding&from_ts=1755783890661&to_ts=1755787490661&live=true)
<img width="1227" height="1196" alt="image"
src="https://github.com/user-attachments/assets/2922eb54-9853-4512-a902-dfa97916b643"
/>
…d traces

  - Add global compression_level config parameter (0-9, default: 6) with fallback hierarchy
  - Support 2-level compression configuration: global level first, then module-specific
  - This makes configuration more convenient - set once globally or override per module
  - Apply compression configuration to metrics flushers and trace processor
  - Add environment variable DD_COMPRESSION_LEVEL for global setting
Copy link
Contributor

@shreyamalpani shreyamalpani left a comment

Choose a reason for hiding this comment

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

Need to check for/use global compression config, if the module-specific config is not set in flushers (edit: its being set in config, all good)

#[serde(deserialize_with = "deserialize_optional_bool_from_anything")]
pub trace_propagation_http_baggage_enabled: Option<bool>,

/// @env `DD_METRICS_CONFIG_COMPRESSION_LEVEL`
Copy link
Contributor

Choose a reason for hiding this comment

The 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

/// @env `DD_TAGS`
#[serde(deserialize_with = "deserialize_key_value_pairs")]
pub tags: HashMap<String, String>,
/// @env `DD_COMPRESSION_LEVEL`
Copy link
Contributor

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?

@litianningdatadog litianningdatadog merged commit 114763a into main Sep 9, 2025
46 checks passed
@litianningdatadog litianningdatadog deleted the tianning.li/SVLS-7461 branch September 9, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants