-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Prometheus] Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms #36647
[Prometheus] Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms #36647
Conversation
…lasticsearch histograms: Use the preceding bucket's value for +Inf 'le', for the first bucket only: if it has a negative 'le', use the value as-is; add test for the negative buckets; extend explanation on the counts calculation Signed-off-by: Tetiana Kravchenko <[email protected]>
This pull request doesn't have a |
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
…s; revert unrelated changes Signed-off-by: Tetiana Kravchenko <[email protected]>
SampleSum: proto.Float64(20), | ||
Bucket: []*p.Bucket{ | ||
{ | ||
UpperBound: proto.Float64(-100), |
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.
Nice!!
@@ -1016,7 +1016,7 @@ func TestGenerateEventsHistogramsDifferentLabels(t *testing.T) { | |||
}, | |||
"http_request_bytes": mapstr.M{ | |||
"histogram": mapstr.M{ | |||
"values": []float64{float64(0.125), float64(0.375), float64(0.75)}, | |||
"values": []float64{float64(0.125), float64(0.375), float64(0.5)}, |
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.
Trying to understand this change: Why we have now 0.5?
Is it due to // Report +Inf bucket as a point, use the preceding bucket's value, and we put the last bucket?
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.
yes, for the last bucket (+Inf 'le') is used the preceding bucket's value, instead of interpolation by adding half the difference between the previous two buckets to the second last bucket
I think this elastic/integrations#5042 can be closed when this is merged |
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.
Code changes themselves look good to me.
Didn't do any validation on the algorithm but I guess it's already discussed? On this, could you link in the description's main context the link to the issue that describes this decision and the motivation?
the original issue for those changes was - #26903 and related discussion - elastic/apm-agent-python#1165 (comment) I've added it to the description and the link to the existing parsing issues |
Signed-off-by: Tetiana Kravchenko <[email protected]>
I've left a comment that this PR covers only partially the scope of the mentioned issue - elastic/integrations#5042 (comment), do you think it can be closed anyway? |
…ograms into Elasticsearch histograms (elastic#36647) * Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms: Use the preceding bucket's value for +Inf 'le', for the first bucket only: if it has a negative 'le', use the value as-is; add test for the negative buckets; extend explanation on the counts calculation Signed-off-by: Tetiana Kravchenko <[email protected]> * fix prometheus remote_write tests; regenerate istio expected documents; revert unrelated changes Signed-off-by: Tetiana Kravchenko <[email protected]> * add link to the design/motivation of the histogram transformation logic Signed-off-by: Tetiana Kravchenko <[email protected]> --------- Signed-off-by: Tetiana Kravchenko <[email protected]>
…ograms into Elasticsearch histograms (elastic#36647) * Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms: Use the preceding bucket's value for +Inf 'le', for the first bucket only: if it has a negative 'le', use the value as-is; add test for the negative buckets; extend explanation on the counts calculation Signed-off-by: Tetiana Kravchenko <[email protected]> * fix prometheus remote_write tests; regenerate istio expected documents; revert unrelated changes Signed-off-by: Tetiana Kravchenko <[email protected]> * add link to the design/motivation of the histogram transformation logic Signed-off-by: Tetiana Kravchenko <[email protected]> --------- Signed-off-by: Tetiana Kravchenko <[email protected]>
Proposed commit message
Align on the algorithm used to transform Prometheus histograms into Elasticsearch histograms Elasticsearch histograms.
The original issue for those changes was - #26903 and related discussion - elastic/apm-agent-python#1165 (comment), in this commit are addressed:
Additionally:
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs