-
Notifications
You must be signed in to change notification settings - Fork 256
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
Allow non-monontonic and empty sums on Histogram data points. #320
Closed
Closed
Changes from all commits
Commits
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
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 | ||||
---|---|---|---|---|---|---|
|
@@ -214,6 +214,18 @@ message Histogram { | |||||
// aggregation_temporality describes if the aggregator reports delta changes | ||||||
// since last report time, or cumulative changes since a fixed start time. | ||||||
AggregationTemporality aggregation_temporality = 2; | ||||||
|
||||||
enum SumType { | ||||||
// The histogram sum is a monotonic value and will not decrease. | ||||||
// Note: This is the default for histograms if unspecified. | ||||||
MONOTONIC = 0; | ||||||
// The histogram sum may increasee or decrease. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
NON_MONOTONIC = 1; | ||||||
// The histogram sum is not meaningful and should be ignored. | ||||||
UNKNOWN_SUM = 2; | ||||||
} | ||||||
// How to interpret the sum field on histogram data points. | ||||||
SumType sum_type = 3; | ||||||
} | ||||||
|
||||||
// Summary metric data are used to convey quantile summaries, | ||||||
|
@@ -384,13 +396,10 @@ message HistogramDataPoint { | |||||
|
||||||
// sum of the values in the population. If count is zero then this field | ||||||
// must be zero. This value must be equal to the sum of the "sum" fields in | ||||||
// buckets if a histogram is provided. | ||||||
// buckets of a histogram if provided. | ||||||
// | ||||||
// Note: Sum should only be filled out when measuring non-negative discrete | ||||||
// events, and is assumed to be monotonic over the values of these events. | ||||||
// Negative events *can* be recorded, but sum should not be filled out when | ||||||
// doing so. This is specifically to enforce compatibility w/ OpenMetrics, | ||||||
// see: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#histogram | ||||||
// Additionally, this field should abide by the interpretation specified | ||||||
// in Histogram.sum_type. | ||||||
double sum = 5; | ||||||
|
||||||
// bucket_counts is an optional field contains the count values of histogram | ||||||
|
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.
Should we avoid 0 as we may not know if it's set or missing?
Maybe...
NONE = 0
MONOTONIC = 1
NON_MONOTONIC = 2
UNKNOWN_SUM = 3
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.
Backwards-commpatiblity means previous users would NOT be specifying this value, which defaults to 0. So we should treat that as MONOTONIC.
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.
Was it that before? Did we have sum as monotonic?
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, sum was monotonic before
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.
From here, that is not clear:
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 the linked bug. Basically we can't not fill out a sum, so due to the phrasing, we're always providing a sum and it's always monotonic.