mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 12:07:47 +00:00
remove deprecated metrics of etcd
This commit is contained in:
parent
1a9b121764
commit
447b17587b
@ -49,16 +49,6 @@ var (
|
|||||||
},
|
},
|
||||||
[]string{"resource"},
|
[]string{"resource"},
|
||||||
)
|
)
|
||||||
|
|
||||||
deprecatedEtcdRequestLatenciesSummary = compbasemetrics.NewSummaryVec(
|
|
||||||
&compbasemetrics.SummaryOpts{
|
|
||||||
Name: "etcd_request_latencies_summary",
|
|
||||||
Help: "Etcd request latency summary in microseconds for each operation and object type.",
|
|
||||||
StabilityLevel: compbasemetrics.ALPHA,
|
|
||||||
DeprecatedVersion: "1.14.0",
|
|
||||||
},
|
|
||||||
[]string{"operation", "type"},
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var registerMetrics sync.Once
|
var registerMetrics sync.Once
|
||||||
@ -69,9 +59,6 @@ func Register() {
|
|||||||
registerMetrics.Do(func() {
|
registerMetrics.Do(func() {
|
||||||
legacyregistry.MustRegister(etcdRequestLatency)
|
legacyregistry.MustRegister(etcdRequestLatency)
|
||||||
legacyregistry.MustRegister(objectCounts)
|
legacyregistry.MustRegister(objectCounts)
|
||||||
|
|
||||||
// TODO(danielqsj): Remove the following metrics, they are deprecated
|
|
||||||
legacyregistry.MustRegister(deprecatedEtcdRequestLatenciesSummary)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,19 +70,11 @@ func UpdateObjectCount(resourcePrefix string, count int64) {
|
|||||||
// RecordEtcdRequestLatency sets the etcd_request_duration_seconds metrics.
|
// RecordEtcdRequestLatency sets the etcd_request_duration_seconds metrics.
|
||||||
func RecordEtcdRequestLatency(verb, resource string, startTime time.Time) {
|
func RecordEtcdRequestLatency(verb, resource string, startTime time.Time) {
|
||||||
etcdRequestLatency.WithLabelValues(verb, resource).Observe(sinceInSeconds(startTime))
|
etcdRequestLatency.WithLabelValues(verb, resource).Observe(sinceInSeconds(startTime))
|
||||||
deprecatedEtcdRequestLatenciesSummary.WithLabelValues(verb, resource).Observe(sinceInMicroseconds(startTime))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset resets the etcd_request_duration_seconds metric.
|
// Reset resets the etcd_request_duration_seconds metric.
|
||||||
func Reset() {
|
func Reset() {
|
||||||
etcdRequestLatency.Reset()
|
etcdRequestLatency.Reset()
|
||||||
|
|
||||||
deprecatedEtcdRequestLatenciesSummary.Reset()
|
|
||||||
}
|
|
||||||
|
|
||||||
// sinceInMicroseconds gets the time since the specified start in microseconds.
|
|
||||||
func sinceInMicroseconds(start time.Time) float64 {
|
|
||||||
return float64(time.Since(start).Nanoseconds() / time.Microsecond.Nanoseconds())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// sinceInSeconds gets the time since the specified start in seconds.
|
// sinceInSeconds gets the time since the specified start in seconds.
|
||||||
|
Loading…
Reference in New Issue
Block a user