fix(profiler): support gzip compression mode#4696
Conversation
Add gzip-to-gzip recompression so DD_PROFILING_DEBUG_COMPRESSION_SETTINGS=gzip works for runtime profiles that are already gzip-compressed. Default gzip mode to gzip-6, matching the compression level legacy mode applies when it compresses profiler-produced profiles. This is done for incident-53386, where zstd caused a memory usage increase. Prompts: > The profiler is using zstd compression by default. It also has a legacy mode. Can you add a gzip mode was well? Outline what needs to be done, ask me questions about anything unclear or complications. > Are you saying DD_PROFILING_DEBUG_COMPRESSION_SETTINGS=gzip already works? > Add a test case for the problem and show it failing to me. > What level of gzip compression does legacy use? make that the default level for "gzip" > Implement the recompression. > Do we even need TestDebugCompressionEnv/explicit-gzip-already-gzipped-input ? > Ok, can you show me that the passthrough mode for the same gzip level works? is that a real case? > jj commit. say that this is done for incident-53386 where zstd has caused memory usage increase.
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: d6b8ffe | Docs | Datadog PR Page | Give us feedback! |
Codecov Report❌ Patch coverage is
Additional details and impacted files
🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-04-27 08:04:04 Comparing candidate commit d6b8ffe in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 270 metrics, 8 unstable metrics.
|
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
devflow unqueued this merge request: It did not become mergeable within the expected time |
997e8b2
into
main
### What does this PR do? See commits. ### Motivation Follow-up cleanups to #4696 suggested by my clanker. Separate PR to make the main one easier to review. ### Reviewer's Checklist <!-- * Authors can use this list as a reference to ensure that there are no problems during the review but the signing off is to be done by the reviewer(s). --> - [ ] Changed code has unit tests for its functionality at or near 100% coverage. - [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag. - [ ] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [ ] New code is free of linting errors. You can check this by running `make lint` locally. - [ ] New code doesn't break existing tests. You can check this by running `make test` locally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [ ] All generated files are up to date. You can check this by running `make generate` locally. - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Unsure? Have a question? Request a review! Co-authored-by: felix.geisendoerfer <[email protected]>
Backport #4696 to the v2.7.x release branch Adds a functional gzip compression mode for the profiler via `DD_PROFILING_DEBUG_COMPRESSION_SETTINGS=gzip`. This was already kinda working, but not really, hence the "fix" title. - Defaults `gzip` to gzip-6, matching the gzip level legacy mode applies when it compresses profiler-produced profiles. - Adds gzip-to-gzip recompression so gzip mode works for runtime profiles that are already gzip-compressed at gzip-1. - Adds tests for gzip mode and gzip recompression. This is done for incident-53386, where zstd caused a memory usage increase. The gzip mode provides an alternative to the default zstd compression while keeping profiler uploads compressed. Co-authored-by: Felix Geisendörfer <[email protected]>
### What does this PR do? Adds a functional gzip compression mode for the profiler via `DD_PROFILING_DEBUG_COMPRESSION_SETTINGS=gzip`. This was already kinda working, but not really, hence the "fix" title. - Defaults `gzip` to gzip-6, matching the gzip level legacy mode applies when it compresses profiler-produced profiles. - Adds gzip-to-gzip recompression so gzip mode works for runtime profiles that are already gzip-compressed at gzip-1. - Adds tests for gzip mode and gzip recompression. See #4697 for some follow-up cleanups. ### Motivation This is done for incident-53386, where zstd caused a memory usage increase. The gzip mode provides an alternative to the default zstd compression while keeping profiler uploads compressed. ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag. - [ ] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [ ] New code is free of linting errors. You can check this by running `make lint` locally. - [x] New code doesn't break existing tests. You can check this by running `make test` locally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [ ] All generated files are up to date. You can check this by running `make generate` locally. - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally. Tests run: - `go test ./profiler -run 'TestNewCompressionPipeline|TestDebugCompressionEnv/explicit-gzip' -count=1` Co-authored-by: felix.geisendoerfer <[email protected]>
What does this PR do?
Adds a functional gzip compression mode for the profiler via
DD_PROFILING_DEBUG_COMPRESSION_SETTINGS=gzip. This was already kinda working, but not really, hence the "fix" title.gzipto gzip-6, matching the gzip level legacy mode applies when it compresses profiler-produced profiles.See #4697 for some follow-up cleanups.
Motivation
This is done for incident-53386, where zstd caused a memory usage increase. The gzip mode provides an alternative to the default zstd compression while keeping profiler uploads compressed.
Reviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.Tests run:
go test ./profiler -run 'TestNewCompressionPipeline|TestDebugCompressionEnv/explicit-gzip' -count=1