Merge pull request #112991 from logicalhan/explicit-stability

add explicit stability levels for shared metrics
This commit is contained in:
Kubernetes Prow Robot 2022-10-12 14:01:02 -07:00 committed by GitHub
commit e4c4e0c50b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 29 deletions

View File

@ -24,8 +24,9 @@ import (
var (
leaderGauge = k8smetrics.NewGaugeVec(&k8smetrics.GaugeOpts{
Name: "leader_election_master_status",
Help: "Gauge of if the reporting system is master of the relevant lease, 0 indicates backup, 1 indicates master. 'name' is the string used to identify the lease. Please make sure to group by name.",
Name: "leader_election_master_status",
StabilityLevel: k8smetrics.ALPHA,
Help: "Gauge of if the reporting system is master of the relevant lease, 0 indicates backup, 1 indicates master. 'name' is the string used to identify the lease. Please make sure to group by name.",
}, []string{"name"})
)

View File

@ -65,17 +65,19 @@ var (
rateLimiterLatency = k8smetrics.NewHistogramVec(
&k8smetrics.HistogramOpts{
Name: "rest_client_rate_limiter_duration_seconds",
Help: "Client side rate limiter latency in seconds. Broken down by verb, and host.",
Buckets: []float64{0.005, 0.025, 0.1, 0.25, 0.5, 1.0, 2.0, 4.0, 8.0, 15.0, 30.0, 60.0},
Name: "rest_client_rate_limiter_duration_seconds",
Help: "Client side rate limiter latency in seconds. Broken down by verb, and host.",
StabilityLevel: k8smetrics.ALPHA,
Buckets: []float64{0.005, 0.025, 0.1, 0.25, 0.5, 1.0, 2.0, 4.0, 8.0, 15.0, 30.0, 60.0},
},
[]string{"verb", "host"},
)
requestResult = k8smetrics.NewCounterVec(
&k8smetrics.CounterOpts{
Name: "rest_client_requests_total",
Help: "Number of HTTP requests, partitioned by status code, method, and host.",
Name: "rest_client_requests_total",
StabilityLevel: k8smetrics.ALPHA,
Help: "Number of HTTP requests, partitioned by status code, method, and host.",
},
[]string{"code", "method", "host"},
)
@ -113,6 +115,7 @@ var (
// - 4 hours - 1 month: captures an ideal rotation cadence.
// - 3 months - 4 years: captures a rotation cadence which is
// is probably too slow or much too slow.
StabilityLevel: k8smetrics.ALPHA,
Buckets: []float64{
600, // 10 minutes
1800, // 30 minutes
@ -131,7 +134,8 @@ var (
execPluginCalls = k8smetrics.NewCounterVec(
&k8smetrics.CounterOpts{
Name: "rest_client_exec_plugin_call_total",
StabilityLevel: k8smetrics.ALPHA,
Name: "rest_client_exec_plugin_call_total",
Help: "Number of calls to an exec plugin, partitioned by the type of " +
"event encountered (no_error, plugin_execution_error, plugin_not_found_error, " +
"client_internal_error) and an optional exit code. The exit code will " +

View File

@ -39,34 +39,39 @@ const (
var (
depth = k8smetrics.NewGaugeVec(&k8smetrics.GaugeOpts{
Subsystem: WorkQueueSubsystem,
Name: DepthKey,
Help: "Current depth of workqueue",
Subsystem: WorkQueueSubsystem,
Name: DepthKey,
StabilityLevel: k8smetrics.ALPHA,
Help: "Current depth of workqueue",
}, []string{"name"})
adds = k8smetrics.NewCounterVec(&k8smetrics.CounterOpts{
Subsystem: WorkQueueSubsystem,
Name: AddsKey,
Help: "Total number of adds handled by workqueue",
Subsystem: WorkQueueSubsystem,
Name: AddsKey,
StabilityLevel: k8smetrics.ALPHA,
Help: "Total number of adds handled by workqueue",
}, []string{"name"})
latency = k8smetrics.NewHistogramVec(&k8smetrics.HistogramOpts{
Subsystem: WorkQueueSubsystem,
Name: QueueLatencyKey,
Help: "How long in seconds an item stays in workqueue before being requested.",
Buckets: k8smetrics.ExponentialBuckets(10e-9, 10, 10),
Subsystem: WorkQueueSubsystem,
Name: QueueLatencyKey,
StabilityLevel: k8smetrics.ALPHA,
Help: "How long in seconds an item stays in workqueue before being requested.",
Buckets: k8smetrics.ExponentialBuckets(10e-9, 10, 10),
}, []string{"name"})
workDuration = k8smetrics.NewHistogramVec(&k8smetrics.HistogramOpts{
Subsystem: WorkQueueSubsystem,
Name: WorkDurationKey,
Help: "How long in seconds processing an item from workqueue takes.",
Buckets: k8smetrics.ExponentialBuckets(10e-9, 10, 10),
Subsystem: WorkQueueSubsystem,
Name: WorkDurationKey,
StabilityLevel: k8smetrics.ALPHA,
Help: "How long in seconds processing an item from workqueue takes.",
Buckets: k8smetrics.ExponentialBuckets(10e-9, 10, 10),
}, []string{"name"})
unfinished = k8smetrics.NewGaugeVec(&k8smetrics.GaugeOpts{
Subsystem: WorkQueueSubsystem,
Name: UnfinishedWorkKey,
Subsystem: WorkQueueSubsystem,
Name: UnfinishedWorkKey,
StabilityLevel: k8smetrics.ALPHA,
Help: "How many seconds of work has done that " +
"is in progress and hasn't been observed by work_duration. Large " +
"values indicate stuck threads. One can deduce the number of stuck " +
@ -74,16 +79,18 @@ var (
}, []string{"name"})
longestRunningProcessor = k8smetrics.NewGaugeVec(&k8smetrics.GaugeOpts{
Subsystem: WorkQueueSubsystem,
Name: LongestRunningProcessorKey,
Subsystem: WorkQueueSubsystem,
Name: LongestRunningProcessorKey,
StabilityLevel: k8smetrics.ALPHA,
Help: "How many seconds has the longest running " +
"processor for workqueue been running.",
}, []string{"name"})
retries = k8smetrics.NewCounterVec(&k8smetrics.CounterOpts{
Subsystem: WorkQueueSubsystem,
Name: RetriesKey,
Help: "Total number of retries handled by workqueue",
Subsystem: WorkQueueSubsystem,
Name: RetriesKey,
StabilityLevel: k8smetrics.ALPHA,
Help: "Total number of retries handled by workqueue",
}, []string{"name"})
metrics = []k8smetrics.Registerable{