You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Looking at SdkDoubleHistogram.java we block negative values in histograms despite this being supported under exponential histograms (via negativebuckets).
Is this intentional or just a side effect of the standard storage of Histograms not permitting negative values?
Steps to reproduce
Emit a negative histogram value
Get a WARN
Nothing emitted
What did you expect to see?
Negative values supported
What did you see instead?
Warning message
What version and what artifacts are you using?
N/A
Environment
N/A
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Unfortunately this is the expectation today. According to the spec:
The value is expected to be non-negative. This API SHOULD be documented in a way to communicate to users that this value is expected to be non-negative. This API SHOULD NOT validate this value, that is left to implementations of the API.
The reason (if I recall correctly) is that when histogram measurements are restricted to positive values, the resulting sum field on output explicit bucket histogram and exponential bucket histogram points is monotonic, which allows it to be used for computing rates. This doesn't seem like a convincing argument to disallow negative values so I may be missing something.
If this is important to you, I encourage you to open an issue in the spec. A search through spec issues for the term "negative" returns a number of conversations about punting on support for negative values until after stability, so it seems appropriate to raise the conversation once again.
jack-berg
changed the title
Should negative histogram values be supported when using Ex
Allow histograms to record measurements with negative values
Jul 19, 2024
Describe the bug
Looking at SdkDoubleHistogram.java we block negative values in histograms despite this being supported under exponential histograms (via negativebuckets).
Is this intentional or just a side effect of the standard storage of Histograms not permitting negative values?
Steps to reproduce
What did you expect to see?
Negative values supported
What did you see instead?
Warning message
What version and what artifacts are you using?
N/A
Environment
N/A
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: