tally
tally copied to clipboard
Mix-matching Histogram Buckets and Report Methods results in silent failure
Whilst using Histograms in Tally, if you mix-match the type the bucket and the value reported. It results in silent failure.
For instance, if you create DurationBuckets and RecordValue (or ValueBuckets and RecordDuration), the code silently skips emitting metrics. Root cause: https://github.com/uber-go/tally/blob/master/stats.go#L369
Repro case:
durationBuckets := tally.MustMakeLinearDurationBuckets(0, 100*time.Millisecond, 10)
rootScope.Histogram("hist-value", durationBuckets).RecordValue(42.) // <-- silent failure
Creating this ticket more to document this failure mode. Future versions should just return an error. For now, maybe its worth emitting an internal metric/log (or worst case panic in such cases).