Fix datadog_metrics handling of Prometheus +Inf histogram buckets - #26135
Fix datadog_metrics handling of Prometheus +Inf histogram buckets#26135anvithsg2004 wants to merge 4 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa0cd0170c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
aa0cd01 to
4c1df75
Compare
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c1df75ddb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
4c1df75 to
48d9b4f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48d9b4fb86
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
48d9b4f to
cc619bb
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5db4bfa393
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| MetricKind::Absolute, | ||
| MetricValue::AggregatedHistogram { | ||
| buckets: vector_lib::buckets![1.0 => 2000, 10.0 => 0], | ||
| buckets: vector_lib::buckets![1.0 => 2000, 10.0 => 0, f64::INFINITY => 0], |
There was a problem hiding this comment.
Set the backward-histogram +Inf expectation correctly
In test_histogram_backward_values, the reverse conversion loop processes the +Inf bucket before mutating the 10 bucket, so its count becomes 2000 - 1000 = 1000; it does not become zero. Consequently, this changed expectation makes the parser unit test fail deterministically. Expect f64::INFINITY => 1000, or change the conversion behavior and test input consistently.
AGENTS.md reference: AGENTS.md:L62-L66
Useful? React with 👍 / 👎.
What does this PR do?
This fixes an issue where Prometheus histogram observations that fall into the implicit
+Infbucket can be lost by thedatadog_metricssink and result in an empty Datadog sketch payload.The Prometheus parser previously removed the
+Infbucket after converting cumulative bucket counts to per-bucket counts. This caused valid observations above the highest finite bucket to be discarded.This PR:
+Infbucket and its observations in the Prometheus parser.+Infbucket during DDSketch interpolation.Sketchmetrics as well.Why?
For example, a histogram such as:
represents four valid observations above
1.0.Previously, the
+Infbucket was removed, leaving no bucket observations to insert into the DDSketch. This could produce an empty sketch, which was subsequently encoded as an emptySketchPayloadand rejected by Datadog with HTTP400 Bad Request.The
+Infbucket is now preserved, allowing the observations to be represented in the DDSketch.Tests
Added and updated tests covering:
+Infbuckets.+Infbuckets.+Infbucket.+Infobservations.