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

feat: add zstd and compress #558

Merged
merged 12 commits into from
Feb 20, 2025
Merged

feat: add zstd and compress #558

merged 12 commits into from
Feb 20, 2025

Conversation

astuyve
Copy link
Contributor

@astuyve astuyve commented Feb 18, 2025

Adds zstd and compresses log payloads. Improves perf for people sending large/many logs:
image

I did not test a representative corpus of data so my intention is to test it in self monitoring, but I assume most logs are duplicates and will compress nicely. Went from 44mb on the network to 14mb, and dropped post runtime duration substantially, so that seems worthwhile.

@astuyve astuyve requested a review from a team as a code owner February 18, 2025 21:23

if !data.is_empty() {
let resp: Result<reqwest::Response, reqwest::Error> = client
.post(&url)
.header("DD-API-KEY", api_key)
.header("DD-PROTOCOL", "agent-json")
.header("Content-Type", "application/json")
.body(data)
.header("Content-Encoding", "zstd")
Copy link
Contributor

Choose a reason for hiding this comment

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

should we add an option to enable/disable decompression?
It might be needed for audit or other user side application

@astuyve astuyve merged commit 496845d into main Feb 20, 2025
33 checks passed
@astuyve astuyve deleted the aj/gzip-logs-payloads branch February 20, 2025 18:07
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.

3 participants