-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[exporter/prometheusexporter] accumulate delta temporality histograms #20530
Closed
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
574b131
[exporter/prometheusexporter] accumulate delta temporality sums and h…
nabam 2385f79
Merge branch 'main' into delta-prom
nabam ac88fb9
Update exporter/prometheusexporter/accumulator.go
nabam b96d0f5
Update exporter/prometheusexporter/accumulator.go
nabam f21cc65
Merge branch 'main' into chore/rebase-nabam-delta-prom
locmai 3c69be1
fix tests
locmai ba8d644
add back aggregation change
locmai d9d5b95
set empty histogram
locmai 4034315
demo
locmai 3631465
Revert "demo"
locmai aa6d049
Revert "Revert "demo""
locmai 11bb9a6
update aggTemporality
locmai 6f805d3
update changelog
locmai 7b5aa64
fix the tests by setting bounds and bucket counts
locmai 1979cbf
fix per aneurysm9's comment
locmai 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
This file contains 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,11 @@ | ||
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' | ||
change_type: enhancement | ||
|
||
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) | ||
component: prometheusexporter | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Accumulate histograms with delta temporality | ||
|
||
# One or more tracking issues related to the change | ||
issues: [4968] |
This file contains 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 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
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.
What happens if the
current.Timestamp()
is older butcurrent.StartTimestamp()
is newer? Or the inverse? I'm not sure it's correct to allow these values to be taken from different data points.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.
Do you mean something like this:
TBH I'm not sure. We had a similar case for Sums and would consider it a single-write principle violation ( https://opentelemetry.io/docs/reference/specification/metrics/data-model/#sums-detecting-alignment-issues)
With the current implementation, we would take the newer one based on the
Timestamp()
comparison. Though here are the options we could consider: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.
Do you need any help here?
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.
Hi @bitomaxsp, thanks for joining.
The above concern from @Aneurysm9 is what we had left (so far). I don' think I addressed it well. We are discussing about what to do with the case where:
as I understand, this could happened due to the multi-writers or bugs from the clients.
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.
In this case I think the current implementation would result in
dest
takingStartTimestamp
fromprev
andTimestamp
fromcurrent
without any indication that it had combined them.I'm not really sure what the right thing to do here is, but I would suggest at least logging a warning if
current.StartTimestamp().Before(prev.Timestamp())
. I think this situation would indicate an inconsistency in the production of the metrics and shouldn't be silently accepted.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.
Logging a warning seems reasonable.
But also should not we drop points that doesn't fit in the time interval (in addition to printing a warning) ?
Let me know, i can test it again when you fix 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.
See my comments below why it's crashing
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.
Okay my memory come back a little bit here with the 3 cases:
Case 1: Delta-to-cumulative
We take the accumulated sum of them only if the current.StartTimestamp() == prev.StartTimestamp()
Case 2: Reset
Since the current.StartTimestamp() is after the prev.Timestamp() - we understand it as the delta has been reset.
Case 3: Anything else - for example:
We only keep the latest Timestamp. Which means whatever ended with latest
Timestamp()
will be kept. Which for this case we would log the warning message out.Reference the Sum approach: https://opentelemetry.io/docs/reference/specification/metrics/data-model/#sums-delta-to-cumulative
@bitomaxsp
I did the delta-to-cumulative for the Sum at the same time Lev made the #9006 as I was in need of using it for the Sum/Counter. So for this PR I left that part out as it has been done.