google/go-metrics-stackdriver

Sampling Results Inaccurate

Opened this issue · 2 comments

This library used to work, but lately it started to produce weird and inaccurate values.
If I run the full example and check in stackdriver UI for foo metric: m.AddSample([]string{"foo"}, 100), the result in stackdriver is 75 for some reason. It happens on every sample in the basic example.

Screen Shot 2022-01-11 at 0 44 08

I'm seeing something similar. I'm reporting values between 0 and 1 being reported as 10.

My issue turned out to be the default bucketer, https://github.com/google/go-metrics-stackdriver/blob/main/stackdriver.go#L169-L171. I defined a custom on and that resolved the issue.