-
Notifications
You must be signed in to change notification settings - Fork 2k
WIP: feat(datadog_metrics sink): switch series v2 endpoint to zstd compression #24956
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
Draft
vladimir-dd
wants to merge
5
commits into
master
Choose a base branch
from
vladimir-dd/metrics-v2-zstd
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+411
−274
Draft
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
783f621
feat(datadog_metrics sink): add zstd compression for series v2 endpoint
vladimir-dd 7ad9f31
fix(docker): add libsasl2-2 runtime dep to Debian-based images
vladimir-dd 5343638
Merge branch 'fix/libsasl2-missing-in-docker-images' into vladimir-dd…
vladimir-dd d96bdb1
fix(datadog_metrics sink): fix compressed size check in try_compress_…
vladimir-dd be47c35
test(datadog_metrics sink): add regression test for compressed limit …
vladimir-dd 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
3 changes: 3 additions & 0 deletions
3
changelog.d/24956_datadog_metrics_zstd_series_v2.enhancement.md
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 |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| The `datadog_metrics` sink now uses zstd compression when submitting metrics to the Series v2 endpoint (`/api/v2/series`). Series v1 and Sketches continue to use zlib (deflate). | ||
|
|
||
| authors: vladimir-dd |
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.
zstd1encoding tokenFor Series v2,
content_encoding()now emits"zstd", but Datadog’s generated Metrics v2 client docs forsubmit_metricslist allowedcontent_encodingvalues asdeflate,zstd1, andgzip(seeMetricsAPI#submit_metricsallowable values at https://datadoghq.dev/datadog-api-client-ruby/DatadogAPIClient/V2/MetricsAPI.html). If the intake strictly validates this enum, all v2 requests from this change will carry an invalidContent-Encodingheader and be rejected with 4xx responses, causing metric loss.Useful? React with 👍 / 👎.
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.
nah, look at the datadog-agent https://github.com/DataDog/datadog-agent/blob/d3c15fd4149516e3562f9b355088a9dca066a61f/pkg/util/compression/compression.go#L30
Uh oh!
There was an error while loading. Please reload this page.
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.
@codex agreed?
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.
I don’t agree with the “nah” reply.
src/sinks/datadog/metrics/config.rscurrently sets Series v2 toContent-Encoding: zstdat line 132, notzstd1.Given Datadog’s generated Metrics v2 client docs/code show allowed
content_encodingvalues asdeflate,zstd1, andgzip, this looks like a real compatibility risk if intake enforces that enum. (Source: https://datadoghq.dev/datadog-api-client-ruby/DatadogAPIClient/V2/MetricsAPI.html)The datadog-agent reference is useful context, but it doesn’t conclusively prove the public v2 intake accepts
zstdtoken interchangeably withzstd1for this endpoint. So from a PR-review safety standpoint, I’d treat this as a valid P1 until proven otherwise.Checks run
sed -n '110,150p' src/sinks/datadog/metrics/config.rsnl -ba src/sinks/datadog/metrics/config.rs | sed -n '120,145p'View task →
Uh oh!
There was an error while loading. Please reload this page.
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.
are you saying that datadog agent might be failing all metrics requests today? that would be a disaster, wouldn't it?
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.
@codex ?
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.
Summary
Content-Encodingtoken from"zstd"to"zstd1"inDatadogMetricsCompression::content_encoding(), while keeping v1/sketches on"deflate". This addresses the review-thread compatibility concern for/api/v2/seriesheader enum handling.413541c.make_prtitled[Follow-up] Use \zstd1` Content-Encoding token for Datadog Metrics v2`.Testing
make check-clippycargo test --no-default-features --features sinks-datadog_metrics datadog_metrics --libView task →