@@ -30,39 +30,47 @@ const (
30
30
statusFailUnknown = "fail-unknown"
31
31
)
32
32
33
+ /*
34
+ * By default, all the following metrics are defined as falling under
35
+ * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes)
36
+ *
37
+ * Promoting the stability level of the metric is a responsibility of the component owner, since it
38
+ * involves explicitly acknowledging support for the metric across multiple releases, in accordance with
39
+ * the metric stability policy.
40
+ */
33
41
var storageOperationMetric = metrics .NewHistogramVec (
34
42
& metrics.HistogramOpts {
35
- Name : "storage_operation_duration_seconds" ,
36
- Help : "Storage operation duration" ,
37
- Buckets : []float64 {.1 , .25 , .5 , 1 , 2.5 , 5 , 10 , 15 , 25 , 50 , 120 , 300 , 600 },
43
+ Name : "storage_operation_duration_seconds" ,
44
+ Help : "Storage operation duration" ,
45
+ Buckets : []float64 {.1 , .25 , .5 , 1 , 2.5 , 5 , 10 , 15 , 25 , 50 , 120 , 300 , 600 },
38
46
StabilityLevel : metrics .ALPHA ,
39
47
},
40
48
[]string {"volume_plugin" , "operation_name" },
41
49
)
42
50
43
51
var storageOperationErrorMetric = metrics .NewCounterVec (
44
52
& metrics.CounterOpts {
45
- Name : "storage_operation_errors_total" ,
46
- Help : "Storage operation errors" ,
53
+ Name : "storage_operation_errors_total" ,
54
+ Help : "Storage operation errors" ,
47
55
StabilityLevel : metrics .ALPHA ,
48
56
},
49
57
[]string {"volume_plugin" , "operation_name" },
50
58
)
51
59
52
60
var storageOperationStatusMetric = metrics .NewCounterVec (
53
61
& metrics.CounterOpts {
54
- Name : "storage_operation_status_count" ,
55
- Help : "Storage operation return statuses count" ,
62
+ Name : "storage_operation_status_count" ,
63
+ Help : "Storage operation return statuses count" ,
56
64
StabilityLevel : metrics .ALPHA ,
57
65
},
58
66
[]string {"volume_plugin" , "operation_name" , "status" },
59
67
)
60
68
61
69
var storageOperationEndToEndLatencyMetric = metrics .NewHistogramVec (
62
70
& metrics.HistogramOpts {
63
- Name : "volume_operation_total_seconds" ,
64
- Help : "Storage operation end to end duration in seconds" ,
65
- Buckets : []float64 {.1 , .25 , .5 , 1 , 2.5 , 5 , 10 , 15 , 25 , 50 , 120 , 300 , 600 },
71
+ Name : "volume_operation_total_seconds" ,
72
+ Help : "Storage operation end to end duration in seconds" ,
73
+ Buckets : []float64 {.1 , .25 , .5 , 1 , 2.5 , 5 , 10 , 15 , 25 , 50 , 120 , 300 , 600 },
66
74
StabilityLevel : metrics .ALPHA ,
67
75
},
68
76
[]string {"plugin_name" , "operation_name" },
@@ -73,6 +81,8 @@ func init() {
73
81
}
74
82
75
83
func registerMetrics () {
84
+ // legacyregistry is the internal k8s wrapper around the prometheus
85
+ // global registry, used specifically for metric stability enforcement
76
86
legacyregistry .MustRegister (storageOperationMetric )
77
87
legacyregistry .MustRegister (storageOperationErrorMetric )
78
88
legacyregistry .MustRegister (storageOperationStatusMetric )
0 commit comments