mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Use Histogram instead of Summary
A histogram allows to aggregate by labels and calculate more comprehensive quantiles.
This commit is contained in:
parent
49e2074f74
commit
2b66b49a2f
@ -30,11 +30,11 @@ import (
|
||||
var (
|
||||
// requestLatency is a Prometheus Summary metric type partitioned by
|
||||
// "verb" and "url" labels. It is used for the rest client latency metrics.
|
||||
requestLatency = prometheus.NewSummaryVec(
|
||||
prometheus.SummaryOpts{
|
||||
Name: "rest_client_request_latency_seconds",
|
||||
Help: "Request latency in seconds. Broken down by verb and URL.",
|
||||
MaxAge: time.Hour,
|
||||
requestLatency = prometheus.NewHistogramVec(
|
||||
prometheus.HistogramOpts{
|
||||
Name: "rest_client_request_latency_seconds",
|
||||
Help: "Request latency in seconds. Broken down by verb and URL.",
|
||||
Buckets: prometheus.ExponentialBuckets(0.001, 2, 10),
|
||||
},
|
||||
[]string{"verb", "url"},
|
||||
)
|
||||
@ -55,7 +55,7 @@ func init() {
|
||||
}
|
||||
|
||||
type latencyAdapter struct {
|
||||
m *prometheus.SummaryVec
|
||||
m *prometheus.HistogramVec
|
||||
}
|
||||
|
||||
func (l *latencyAdapter) Observe(verb string, u url.URL, latency time.Duration) {
|
||||
|
Loading…
Reference in New Issue
Block a user