mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +00:00
Merge pull request #8795 from a-robinson/latency
Remove the clientID field from the apiserver request latency metric
This commit is contained in:
commit
9e486be743
@ -63,7 +63,7 @@ var (
|
|||||||
// Use buckets ranging from 125 ms to 8 seconds.
|
// Use buckets ranging from 125 ms to 8 seconds.
|
||||||
Buckets: prometheus.ExponentialBuckets(125000, 2.0, 7),
|
Buckets: prometheus.ExponentialBuckets(125000, 2.0, 7),
|
||||||
},
|
},
|
||||||
[]string{"verb", "resource", "client"},
|
[]string{"verb", "resource"},
|
||||||
)
|
)
|
||||||
requestLatenciesSummary = prometheus.NewSummaryVec(
|
requestLatenciesSummary = prometheus.NewSummaryVec(
|
||||||
prometheus.SummaryOpts{
|
prometheus.SummaryOpts{
|
||||||
@ -84,7 +84,7 @@ func init() {
|
|||||||
// instrumenting basic request counter and latency metrics.
|
// instrumenting basic request counter and latency metrics.
|
||||||
func monitor(verb, resource *string, client string, httpCode *int, reqStart time.Time) {
|
func monitor(verb, resource *string, client string, httpCode *int, reqStart time.Time) {
|
||||||
requestCounter.WithLabelValues(*verb, *resource, client, strconv.Itoa(*httpCode)).Inc()
|
requestCounter.WithLabelValues(*verb, *resource, client, strconv.Itoa(*httpCode)).Inc()
|
||||||
requestLatencies.WithLabelValues(*verb, *resource, client).Observe(float64((time.Since(reqStart)) / time.Microsecond))
|
requestLatencies.WithLabelValues(*verb, *resource).Observe(float64((time.Since(reqStart)) / time.Microsecond))
|
||||||
requestLatenciesSummary.WithLabelValues(*verb, *resource).Observe(float64((time.Since(reqStart)) / time.Microsecond))
|
requestLatenciesSummary.WithLabelValues(*verb, *resource).Observe(float64((time.Since(reqStart)) / time.Microsecond))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user