Open abarganier opened 11 months ago
My understanding is that the primary histogram type tightly couples collection of histogram data with its reporting through timeseries / grafana. I think we should consider decoupling those two responsibilities. We can still offer convenience facilities for composing the two. Decoupling will allow Pebble, the go runtime, and possibly other dependencies to collect their own histogram data without maintaining separate reporting types.
Is your feature request related to a problem? Please describe. Today, we have 5 different histogram implementations:
Histogram
HdrHistogram
ManualWindowHistogram
AggHistogram
runtimeHistogram
With so many implementations, it's no wonder that we find ourselves dealing with histogram bugs lately. Updating the code requires one to be very thorough, updating 5 different implementations where the "right" thing to do isn't always obvious. It's easy to miss something and introduce bugs. For example, just recently I can recall a few instances where bugs were introduced to the histogram library:
Histograms are critical to customer trust. This level of toil is unacceptable, and action needs to be taken to improve our situation here.
Describe the solution you'd like Many of these histograms mostly wrap
Histogram
, with small differences. Does an entirely separate implementation need to exist? Instead, I propose we:metric.HistogramOptions
that already exists today) can be used to configure desired behavior.HdrHistogram
once the unified histogram is tested & proven.Jira issue: CRDB-34675