diff --git a/metrics/prometheus/collector.go b/metrics/prometheus/collector.go index a6cbcd64a7..58bd8ffb7f 100644 --- a/metrics/prometheus/collector.go +++ b/metrics/prometheus/collector.go @@ -114,6 +114,7 @@ func (c *collector) addTimer(name string, m metrics.TimerSnapshot) { pv := []float64{0.5, 0.75, 0.95, 0.99, 0.999, 0.9999} ps := m.Percentiles(pv) c.writeSummaryCounter(name, m.Count()) + c.writeSummaryCounter(mutateKey(name+"_total"), m.Total().Nanoseconds()) c.buff.WriteString(fmt.Sprintf(typeSummaryTpl, mutateKey(name))) for i := range pv { c.writeSummaryPercentile(name, strconv.FormatFloat(pv[i], 'f', -1, 64), ps[i]) diff --git a/metrics/prometheus/testdata/prometheus.want b/metrics/prometheus/testdata/prometheus.want index 861c5f5cf0..97e51634d6 100644 --- a/metrics/prometheus/testdata/prometheus.want +++ b/metrics/prometheus/testdata/prometheus.want @@ -60,6 +60,9 @@ test_resetting_timer {quantile="0.99"} 1.2e+08 # TYPE test_timer_count counter test_timer_count 6 +# TYPE test_timer_total_count counter +test_timer_total_count 230000000 + # TYPE test_timer summary test_timer {quantile="0.5"} 2.25e+07 test_timer {quantile="0.75"} 4.8e+07