-
Notifications
You must be signed in to change notification settings - Fork 202
ignore negative bucket bounds #1499
ignore negative bucket bounds #1499
Conversation
For backwards-compatibility, I think we need to continue supporting negative buckets in Stats APIs. In my opinion we should drop the negative buckets when converting @bogdandrutu WDYT? |
Codecov Report
@@ Coverage Diff @@
## master #1499 +/- ##
============================================
+ Coverage 82.56% 82.71% +0.15%
- Complexity 1662 1674 +12
============================================
Files 251 251
Lines 7753 7781 +28
Branches 756 763 +7
============================================
+ Hits 6401 6436 +35
+ Misses 1125 1121 -4
+ Partials 227 224 -3
Continue to review full report at Codecov.
|
Negative values are currently not supported by any of the backends that we support and have histograms (Stackdriver and Prometheus). In Stackdriver for example sum cannot go down. There are multiple things to consider:
|
Given the complexity of maintaining both the positive and negative aggregated values, I think dropping negative values makes more sense. An alternative is to throw an unchecked exception for negative values so that users will be noticed that negative values are no longer supported (instead of silently skipping them). |
I think 2nd option will make things really complicated and might create a pain in future in maintaining that. I am in favor of 3rd option, also throwing an exception will make things clear for users. |
I think we should not directly throw an exception. We can start with logging an error for few versions then throw an exception. We should explain this to the current users very clearly. |
Agree that logging is a good starting point. We should document this behavior in the Javadoc as well as in the CHANGELOG. |
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.
IIUC the idea is to not allow negative values in MeasureMap.record
? Or at least, drop negative values in MutableDistribution.record
.
With your current approach, sum
and count
can still accept negative values and can go unsync with the bucket counts.
impl_core/src/main/java/io/opencensus/implcore/stats/MutableAggregation.java
Outdated
Show resolved
Hide resolved
I agree with @songy23 we should drop negative values in the Record (and drop all recorded values in that record batch). |
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.
LGTM
No description provided.