tally icon indicating copy to clipboard operation
tally copied to clipboard

Mix-matching Histogram Buckets and Report Methods results in silent failure

Open prateek opened this issue 2 years ago • 0 comments

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).

prateek avatar Nov 29 '23 22:11 prateek