mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 20:17:41 +00:00
remove deprecated metrics of dockershim
This commit is contained in:
parent
060756babb
commit
8ae3f80048
@ -42,9 +42,7 @@ func NewInstrumentedInterface(dockerClient Interface) Interface {
|
||||
// recordOperation records the duration of the operation.
|
||||
func recordOperation(operation string, start time.Time) {
|
||||
metrics.DockerOperations.WithLabelValues(operation).Inc()
|
||||
metrics.DeprecatedDockerOperations.WithLabelValues(operation).Inc()
|
||||
metrics.DockerOperationsLatency.WithLabelValues(operation).Observe(metrics.SinceInSeconds(start))
|
||||
metrics.DeprecatedDockerOperationsLatency.WithLabelValues(operation).Observe(metrics.SinceInMicroseconds(start))
|
||||
}
|
||||
|
||||
// recordError records error for metric if an error occurred.
|
||||
@ -52,11 +50,9 @@ func recordError(operation string, err error) {
|
||||
if err != nil {
|
||||
if _, ok := err.(operationTimeout); ok {
|
||||
metrics.DockerOperationsTimeout.WithLabelValues(operation).Inc()
|
||||
metrics.DeprecatedDockerOperationsTimeout.WithLabelValues(operation).Inc()
|
||||
}
|
||||
// Docker operation timeout error is also a docker error, so we don't add else here.
|
||||
metrics.DockerOperationsErrors.WithLabelValues(operation).Inc()
|
||||
metrics.DeprecatedDockerOperationsErrors.WithLabelValues(operation).Inc()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,15 +34,6 @@ const (
|
||||
// DockerOperationsTimeoutKey is the key for the operation timeout metrics.
|
||||
DockerOperationsTimeoutKey = "docker_operations_timeout_total"
|
||||
|
||||
// DeprecatedDockerOperationsKey is the deprecated key for docker operation metrics.
|
||||
DeprecatedDockerOperationsKey = "docker_operations"
|
||||
// DeprecatedDockerOperationsLatencyKey is the deprecated key for the operation latency metrics.
|
||||
DeprecatedDockerOperationsLatencyKey = "docker_operations_latency_microseconds"
|
||||
// DeprecatedDockerOperationsErrorsKey is the deprecated key for the operation error metrics.
|
||||
DeprecatedDockerOperationsErrorsKey = "docker_operations_errors"
|
||||
// DeprecatedDockerOperationsTimeoutKey is the deprecated key for the operation timeout metrics.
|
||||
DeprecatedDockerOperationsTimeoutKey = "docker_operations_timeout"
|
||||
|
||||
// Keep the "kubelet" subsystem for backward compatibility.
|
||||
kubeletSubsystem = "kubelet"
|
||||
)
|
||||
@ -91,53 +82,6 @@ var (
|
||||
},
|
||||
[]string{"operation_type"},
|
||||
)
|
||||
|
||||
// DeprecatedDockerOperationsLatency collects operation latency numbers by operation
|
||||
// type.
|
||||
DeprecatedDockerOperationsLatency = metrics.NewSummaryVec(
|
||||
&metrics.SummaryOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
Name: DeprecatedDockerOperationsLatencyKey,
|
||||
Help: "Latency in microseconds of Docker operations. Broken down by operation type.",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
DeprecatedVersion: "1.14.0",
|
||||
},
|
||||
[]string{"operation_type"},
|
||||
)
|
||||
// DeprecatedDockerOperations collects operation counts by operation type.
|
||||
DeprecatedDockerOperations = metrics.NewCounterVec(
|
||||
&metrics.CounterOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
Name: DeprecatedDockerOperationsKey,
|
||||
Help: "Cumulative number of Docker operations by operation type.",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
DeprecatedVersion: "1.14.0",
|
||||
},
|
||||
[]string{"operation_type"},
|
||||
)
|
||||
// DeprecatedDockerOperationsErrors collects operation errors by operation
|
||||
// type.
|
||||
DeprecatedDockerOperationsErrors = metrics.NewCounterVec(
|
||||
&metrics.CounterOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
Name: DeprecatedDockerOperationsErrorsKey,
|
||||
Help: "Cumulative number of Docker operation errors by operation type.",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
DeprecatedVersion: "1.14.0",
|
||||
},
|
||||
[]string{"operation_type"},
|
||||
)
|
||||
// DeprecatedDockerOperationsTimeout collects operation timeouts by operation type.
|
||||
DeprecatedDockerOperationsTimeout = metrics.NewCounterVec(
|
||||
&metrics.CounterOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
Name: DeprecatedDockerOperationsTimeoutKey,
|
||||
Help: "Cumulative number of Docker operation timeout by operation type.",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
DeprecatedVersion: "1.14.0",
|
||||
},
|
||||
[]string{"operation_type"},
|
||||
)
|
||||
)
|
||||
|
||||
var registerMetrics sync.Once
|
||||
@ -149,10 +93,6 @@ func Register() {
|
||||
legacyregistry.MustRegister(DockerOperations)
|
||||
legacyregistry.MustRegister(DockerOperationsErrors)
|
||||
legacyregistry.MustRegister(DockerOperationsTimeout)
|
||||
legacyregistry.MustRegister(DeprecatedDockerOperationsLatency)
|
||||
legacyregistry.MustRegister(DeprecatedDockerOperations)
|
||||
legacyregistry.MustRegister(DeprecatedDockerOperationsErrors)
|
||||
legacyregistry.MustRegister(DeprecatedDockerOperationsTimeout)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,6 @@ const (
|
||||
NetworkPluginOperationsKey = "network_plugin_operations"
|
||||
// NetworkPluginOperationsLatencyKey is the key for the operation latency metrics.
|
||||
NetworkPluginOperationsLatencyKey = "network_plugin_operations_duration_seconds"
|
||||
// DeprecatedNetworkPluginOperationsLatencyKey is the deprecated key for the operation latency metrics.
|
||||
DeprecatedNetworkPluginOperationsLatencyKey = "network_plugin_operations_latency_microseconds"
|
||||
|
||||
// Keep the "kubelet" subsystem for backward compatibility.
|
||||
kubeletSubsystem = "kubelet"
|
||||
@ -49,19 +47,6 @@ var (
|
||||
},
|
||||
[]string{"operation_type"},
|
||||
)
|
||||
|
||||
// DeprecatedNetworkPluginOperationsLatency collects operation latency numbers by operation
|
||||
// type.
|
||||
DeprecatedNetworkPluginOperationsLatency = metrics.NewSummaryVec(
|
||||
&metrics.SummaryOpts{
|
||||
Subsystem: kubeletSubsystem,
|
||||
Name: DeprecatedNetworkPluginOperationsLatencyKey,
|
||||
Help: "Latency in microseconds of network plugin operations. Broken down by operation type.",
|
||||
StabilityLevel: metrics.ALPHA,
|
||||
DeprecatedVersion: "1.14.0",
|
||||
},
|
||||
[]string{"operation_type"},
|
||||
)
|
||||
)
|
||||
|
||||
var registerMetrics sync.Once
|
||||
@ -70,7 +55,6 @@ var registerMetrics sync.Once
|
||||
func Register() {
|
||||
registerMetrics.Do(func() {
|
||||
legacyregistry.MustRegister(NetworkPluginOperationsLatency)
|
||||
legacyregistry.MustRegister(DeprecatedNetworkPluginOperationsLatency)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,6 @@ func (pm *PluginManager) podUnlock(fullPodName string) {
|
||||
// recordOperation records operation and duration
|
||||
func recordOperation(operation string, start time.Time) {
|
||||
metrics.NetworkPluginOperationsLatency.WithLabelValues(operation).Observe(metrics.SinceInSeconds(start))
|
||||
metrics.DeprecatedNetworkPluginOperationsLatency.WithLabelValues(operation).Observe(metrics.SinceInMicroseconds(start))
|
||||
}
|
||||
|
||||
func (pm *PluginManager) GetPodNetworkStatus(podNamespace, podName string, id kubecontainer.ContainerID) (*PodNetworkStatus, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user