Open Michaelhobo opened 3 years ago
The gauge test seems to think this is correct behavior: https://github.com/census-instrumentation/opencensus-go/blob/master/metric/gauge_test.go#L270
Why is this the case? If a Gauge's Add function can accept negative values, it seems counterintuitive that negative gauge values always return 0.
Please answer these questions before submitting a bug report.
What version of OpenCensus are you using?
0.22.5
What version of Go are you using?
1.14
What did you do?
If possible, provide a recipe for reproducing the error.
I'm writing a wrapper library for opencensus. While writing tests, I noticed that gauges don't seem to handle negative values. You can reproduce this here: https://play.golang.org/p/y2skt697rOc
What did you expect to see?
The Float/Int64Gauge tests that go negative fail. When the gauge stays positive, the tests pass.
What did you see instead?
It seems like any negative value causes the gauge to go to 0.
Here's the test output, in case the playground doesn't compile later:
Additional context
Add any other context about the problem here.