From 4e5d906c4d008f914b0ede26ea91533d6343dec5 Mon Sep 17 00:00:00 2001 From: Han Kang Date: Mon, 26 Aug 2019 19:15:30 -0700 Subject: [PATCH] add some documentation around the metrics stability migration changes for clarity --- pkg/ssh/ssh.go | 8 ++++++++ staging/src/k8s.io/apiserver/pkg/audit/metrics.go | 8 ++++++++ .../apiserver/pkg/authentication/request/x509/x509.go | 8 ++++++++ .../apiserver/pkg/endpoints/filters/authentication.go | 8 ++++++++ .../src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go | 8 ++++++++ staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go | 8 ++++++++ .../k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go | 8 ++++++++ staging/src/k8s.io/apiserver/pkg/storage/value/metrics.go | 8 ++++++++ .../kube-aggregator/pkg/controllers/status/metrics.go | 8 ++++++++ .../src/k8s.io/legacy-cloud-providers/gce/token_source.go | 8 ++++++++ 10 files changed, 80 insertions(+) diff --git a/pkg/ssh/ssh.go b/pkg/ssh/ssh.go index f3d68b4225e..5b6072244ac 100644 --- a/pkg/ssh/ssh.go +++ b/pkg/ssh/ssh.go @@ -46,6 +46,14 @@ import ( "k8s.io/klog" ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( tunnelOpenCounter = metrics.NewCounter( &metrics.CounterOpts{ diff --git a/staging/src/k8s.io/apiserver/pkg/audit/metrics.go b/staging/src/k8s.io/apiserver/pkg/audit/metrics.go index 6c51d1385dd..88d4154e8ae 100644 --- a/staging/src/k8s.io/apiserver/pkg/audit/metrics.go +++ b/staging/src/k8s.io/apiserver/pkg/audit/metrics.go @@ -29,6 +29,14 @@ const ( subsystem = "apiserver_audit" ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( eventCounter = metrics.NewCounter( &metrics.CounterOpts{ diff --git a/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go b/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go index 364ac2d94ec..d45c863402c 100644 --- a/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go +++ b/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go @@ -31,6 +31,14 @@ import ( "k8s.io/component-base/metrics/legacyregistry" ) +/* + * By default, the following metric is defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var clientCertificateExpirationHistogram = metrics.NewHistogram( &metrics.HistogramOpts{ Namespace: "apiserver", diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/filters/authentication.go b/staging/src/k8s.io/apiserver/pkg/endpoints/filters/authentication.go index 17b456a031e..1b4de1899f1 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/filters/authentication.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/filters/authentication.go @@ -32,6 +32,14 @@ import ( "k8s.io/klog" ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( authenticatedUserCounter = metrics.NewCounterVec( &metrics.CounterOpts{ diff --git a/staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go b/staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go index 42949645685..30ce24a4bd8 100644 --- a/staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go +++ b/staging/src/k8s.io/apiserver/pkg/endpoints/metrics/metrics.go @@ -52,6 +52,14 @@ const ( APIServerComponent string = "apiserver" ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( // TODO(a-robinson): Add unit tests for the handling of these metrics once // the upstream library supports it. diff --git a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go index f27db4e9d17..822615fb6c6 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go @@ -45,6 +45,14 @@ import ( utiltrace "k8s.io/utils/trace" ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( initCounter = metrics.NewCounterVec( &metrics.CounterOpts{ diff --git a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go index c32326c0464..32210db1646 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/etcd3/metrics/metrics.go @@ -24,6 +24,14 @@ import ( "k8s.io/component-base/metrics/legacyregistry" ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( etcdRequestLatency = compbasemetrics.NewHistogramVec( &compbasemetrics.HistogramOpts{ diff --git a/staging/src/k8s.io/apiserver/pkg/storage/value/metrics.go b/staging/src/k8s.io/apiserver/pkg/storage/value/metrics.go index 179d2b98ee2..f35994688bc 100644 --- a/staging/src/k8s.io/apiserver/pkg/storage/value/metrics.go +++ b/staging/src/k8s.io/apiserver/pkg/storage/value/metrics.go @@ -32,6 +32,14 @@ const ( subsystem = "storage" ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( transformerLatencies = metrics.NewHistogramVec( &metrics.HistogramOpts{ diff --git a/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/metrics.go b/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/metrics.go index a2df8ef2ac1..d6727af576f 100644 --- a/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/metrics.go +++ b/staging/src/k8s.io/kube-aggregator/pkg/controllers/status/metrics.go @@ -21,6 +21,14 @@ import ( "k8s.io/component-base/metrics/legacyregistry" ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( unavailableCounter = metrics.NewCounterVec( &metrics.CounterOpts{ diff --git a/staging/src/k8s.io/legacy-cloud-providers/gce/token_source.go b/staging/src/k8s.io/legacy-cloud-providers/gce/token_source.go index 154652d3e76..6eae376c10c 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/gce/token_source.go +++ b/staging/src/k8s.io/legacy-cloud-providers/gce/token_source.go @@ -41,6 +41,14 @@ const ( tokenURLBurst = 3 ) +/* + * By default, all the following metrics are defined as falling under + * ALPHA stability level https://github.com/kubernetes/enhancements/blob/master/keps/sig-instrumentation/20190404-kubernetes-control-plane-metrics-stability.md#stability-classes) + * + * Promoting the stability level of the metric is a responsibility of the component owner, since it + * involves explicitly acknowledging support for the metric across multiple releases, in accordance with + * the metric stability policy. + */ var ( getTokenCounter = metrics.NewCounter( &metrics.CounterOpts{