Merge pull request #87627 from tallclair/rc-metrics

Register RunPodSandbox* metrics
This commit is contained in:
Kubernetes Prow Robot 2020-01-29 22:11:25 -08:00 committed by GitHub
commit ec3fc59f1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -321,12 +321,12 @@ var (
}, },
) )
// RunPodSandboxDuration is a Histogram that tracks the duration (in seconds) it takes to run Pod Sandbox operations. // RunPodSandboxDuration is a Histogram that tracks the duration (in seconds) it takes to run Pod Sandbox operations.
// Broken down by RuntimeClass. // Broken down by RuntimeClass.Handler.
RunPodSandboxDuration = metrics.NewHistogramVec( RunPodSandboxDuration = metrics.NewHistogramVec(
&metrics.HistogramOpts{ &metrics.HistogramOpts{
Subsystem: KubeletSubsystem, Subsystem: KubeletSubsystem,
Name: RunPodSandboxDurationKey, Name: RunPodSandboxDurationKey,
Help: "Duration in seconds of the run_podsandbox operations. Broken down by RuntimeClass.", Help: "Duration in seconds of the run_podsandbox operations. Broken down by RuntimeClass.Handler.",
// Use DefBuckets for now, will customize the buckets if necessary. // Use DefBuckets for now, will customize the buckets if necessary.
Buckets: metrics.DefBuckets, Buckets: metrics.DefBuckets,
StabilityLevel: metrics.ALPHA, StabilityLevel: metrics.ALPHA,
@ -334,12 +334,12 @@ var (
[]string{"runtime_handler"}, []string{"runtime_handler"},
) )
// RunPodSandboxErrors is a Counter that tracks the cumulative number of Pod Sandbox operations errors. // RunPodSandboxErrors is a Counter that tracks the cumulative number of Pod Sandbox operations errors.
// Broken down by RuntimeClass. // Broken down by RuntimeClass.Handler.
RunPodSandboxErrors = metrics.NewCounterVec( RunPodSandboxErrors = metrics.NewCounterVec(
&metrics.CounterOpts{ &metrics.CounterOpts{
Subsystem: KubeletSubsystem, Subsystem: KubeletSubsystem,
Name: RunPodSandboxErrorsKey, Name: RunPodSandboxErrorsKey,
Help: "Cumulative number of the run_podsandbox operation errors by RuntimeClass.", Help: "Cumulative number of the run_podsandbox operation errors by RuntimeClass.Handler.",
StabilityLevel: metrics.ALPHA, StabilityLevel: metrics.ALPHA,
}, },
[]string{"runtime_handler"}, []string{"runtime_handler"},
@ -392,6 +392,8 @@ func Register(containerCache kubecontainer.RuntimeCache, collectors ...metrics.S
legacyregistry.MustRegister(DevicePluginAllocationDuration) legacyregistry.MustRegister(DevicePluginAllocationDuration)
legacyregistry.MustRegister(RunningContainerCount) legacyregistry.MustRegister(RunningContainerCount)
legacyregistry.MustRegister(RunningPodCount) legacyregistry.MustRegister(RunningPodCount)
legacyregistry.MustRegister(RunPodSandboxDuration)
legacyregistry.MustRegister(RunPodSandboxErrors)
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) { if utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) {
legacyregistry.MustRegister(AssignedConfig) legacyregistry.MustRegister(AssignedConfig)
legacyregistry.MustRegister(ActiveConfig) legacyregistry.MustRegister(ActiveConfig)