Remove sum from Summary#117
Conversation
Just summing all snapshot values does not work with dropwizard metrics, because the values array does not hold all values but only a sample of recent values.
|
I could have sworn there was a way to get this data. |
| new MetricFamilySamples.Sample(name, Arrays.asList("quantile"), Arrays.asList("0.99"), snapshot.get99thPercentile() * factor), | ||
| new MetricFamilySamples.Sample(name, Arrays.asList("quantile"), Arrays.asList("0.999"), snapshot.get999thPercentile() * factor), | ||
| new MetricFamilySamples.Sample(name + "_count", new ArrayList<String>(), new ArrayList<String>(), count), | ||
| new MetricFamilySamples.Sample(name + "_sum", new ArrayList<String>(), new ArrayList<String>(), sum * factor) |
There was a problem hiding this comment.
Removing sum will make prometheus histogram useless. Don't we have a way to get this value elsewhere?
There was a problem hiding this comment.
We still have the quantiles, so it just stops us getting the average.
|
Unfortunately, there actually isn't because the Timer only contains data from approximately the last 5 minutes. One (very bad) estimation would be Do some prometheus query depend on the sum? Which and why? |
|
My understanding is that it will work with uniform reservoirs (http://metrics.dropwizard.io/3.1.0/manual/core/#uniform-reservoirs) but not with exponentially decaying reservoirs (defaults for histogram and timer in dropwizard). In this case (uniform reservoir), getValues(1.0) should work. |
|
|
|
So shall we go ahead and remove this then? |
|
I can't say how this would affect prometheus histogram queries if there is no sum but the current sum value is just plain wrong. |
Just summing all snapshot values does not work with dropwizard metrics, because the values array does not hold all values but only a sample of recent values.