Skip to content

Commit d393d4e

Browse files
authored
Merge pull request kubernetes#120574 from logicalhan/cslis
promote component SLIs to GA; remove feature gates for component slis
2 parents c9114ab + 09d64ed commit d393d4e

File tree

9 files changed

+36
-44
lines changed

9 files changed

+36
-44
lines changed

cmd/kube-controller-manager/app/controllermanager.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,8 @@ func Run(ctx context.Context, c *config.CompletedConfig) error {
215215
var unsecuredMux *mux.PathRecorderMux
216216
if c.SecureServing != nil {
217217
unsecuredMux = genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Generic.Debugging, healthzHandler)
218-
if utilfeature.DefaultFeatureGate.Enabled(features.ComponentSLIs) {
219-
slis.SLIMetricsWithReset{}.Install(unsecuredMux)
220-
}
218+
slis.SLIMetricsWithReset{}.Install(unsecuredMux)
219+
221220
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication)
222221
// TODO: handle stoppedCh and listenerStoppedCh returned by c.SecureServing.Serve
223222
if _, _, err := c.SecureServing.Serve(handler, 0, stopCh); err != nil {

cmd/kube-proxy/app/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,8 @@ func serveMetrics(bindAddress string, proxyMode kubeproxyconfig.ProxyMode, enabl
806806

807807
proxyMux := mux.NewPathRecorderMux("kube-proxy")
808808
healthz.InstallHandler(proxyMux)
809-
if utilfeature.DefaultFeatureGate.Enabled(metricsfeatures.ComponentSLIs) {
810-
slis.SLIMetricsWithReset{}.Install(proxyMux)
811-
}
809+
slis.SLIMetricsWithReset{}.Install(proxyMux)
810+
812811
proxyMux.HandleFunc("/proxyMode", func(w http.ResponseWriter, r *http.Request) {
813812
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
814813
w.Header().Set("X-Content-Type-Options", "nosniff")

cmd/kube-scheduler/app/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,8 @@ func newHealthzAndMetricsHandler(config *kubeschedulerconfig.KubeSchedulerConfig
294294
pathRecorderMux := mux.NewPathRecorderMux("kube-scheduler")
295295
healthz.InstallHandler(pathRecorderMux, checks...)
296296
installMetricHandler(pathRecorderMux, informers, isLeader)
297-
if utilfeature.DefaultFeatureGate.Enabled(features.ComponentSLIs) {
298-
slis.SLIMetricsWithReset{}.Install(pathRecorderMux)
299-
}
297+
slis.SLIMetricsWithReset{}.Install(pathRecorderMux)
298+
300299
if config.EnableProfiling {
301300
routes.Profiling{}.Install(pathRecorderMux)
302301
if config.EnableContentionProfiling {

pkg/kubelet/server/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,8 @@ func (s *Server) InstallDefaultHandlers() {
377377
healthz.NamedCheck("syncloop", s.syncLoopHealthCheck),
378378
)
379379

380-
if utilfeature.DefaultFeatureGate.Enabled(metricsfeatures.ComponentSLIs) {
381-
slis.SLIMetricsWithReset{}.Install(s.restfulCont)
382-
}
380+
slis.SLIMetricsWithReset{}.Install(s.restfulCont)
381+
383382
s.addMetricsBucketMatcher("pods")
384383
ws := new(restful.WebService)
385384
ws.

staging/src/k8s.io/apiserver/pkg/server/config.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -994,14 +994,10 @@ func installAPI(s *GenericAPIServer, c *Config) {
994994
if c.EnableMetrics {
995995
if c.EnableProfiling {
996996
routes.MetricsWithReset{}.Install(s.Handler.NonGoRestfulMux)
997-
if utilfeature.DefaultFeatureGate.Enabled(features.ComponentSLIs) {
998-
slis.SLIMetricsWithReset{}.Install(s.Handler.NonGoRestfulMux)
999-
}
997+
slis.SLIMetricsWithReset{}.Install(s.Handler.NonGoRestfulMux)
1000998
} else {
1001999
routes.DefaultMetrics{}.Install(s.Handler.NonGoRestfulMux)
1002-
if utilfeature.DefaultFeatureGate.Enabled(features.ComponentSLIs) {
1003-
slis.SLIMetrics{}.Install(s.Handler.NonGoRestfulMux)
1004-
}
1000+
slis.SLIMetrics{}.Install(s.Handler.NonGoRestfulMux)
10051001
}
10061002
}
10071003

staging/src/k8s.io/cloud-provider/app/controllermanager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, cloud cloudprovider.Interface
202202
// Start the controller manager HTTP server
203203
if c.SecureServing != nil {
204204
unsecuredMux := genericcontrollermanager.NewBaseHandler(&c.ComponentConfig.Generic.Debugging, healthzHandler)
205-
if utilfeature.DefaultFeatureGate.Enabled(features.ComponentSLIs) {
206-
slis.SLIMetricsWithReset{}.Install(unsecuredMux)
207-
}
205+
206+
slis.SLIMetricsWithReset{}.Install(unsecuredMux)
207+
208208
handler := genericcontrollermanager.BuildHandlerChain(unsecuredMux, &c.Authorization, &c.Authentication)
209209
// TODO: handle stoppedCh and listenerStoppedCh returned by c.SecureServing.Serve
210210
if _, _, err := c.SecureServing.Serve(handler, 0, stopCh); err != nil {

staging/src/k8s.io/component-base/metrics/prometheus/slis/metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var (
3737
Namespace: "kubernetes",
3838
Name: "healthcheck",
3939
Help: "This metric records the result of a single healthcheck.",
40-
StabilityLevel: k8smetrics.BETA,
40+
StabilityLevel: k8smetrics.STABLE,
4141
},
4242
[]string{"name", "type"},
4343
)
@@ -48,7 +48,7 @@ var (
4848
Namespace: "kubernetes",
4949
Name: "healthchecks_total",
5050
Help: "This metric records the results of all healthcheck.",
51-
StabilityLevel: k8smetrics.BETA,
51+
StabilityLevel: k8smetrics.STABLE,
5252
},
5353
[]string{"name", "type", "status"},
5454
)

staging/src/k8s.io/component-base/metrics/prometheus/slis/metrics_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ func TestObserveHealthcheck(t *testing.T) {
3737
initialState := Error
3838
healthcheckName := "healthcheck-a"
3939
initialOutput := `
40-
# HELP kubernetes_healthcheck [BETA] This metric records the result of a single healthcheck.
40+
# HELP kubernetes_healthcheck [STABLE] This metric records the result of a single healthcheck.
4141
# TYPE kubernetes_healthcheck gauge
4242
kubernetes_healthcheck{name="healthcheck-a",type="healthz"} 0
43-
# HELP kubernetes_healthchecks_total [BETA] This metric records the results of all healthcheck.
43+
# HELP kubernetes_healthchecks_total [STABLE] This metric records the results of all healthcheck.
4444
# TYPE kubernetes_healthchecks_total counter
4545
kubernetes_healthchecks_total{name="healthcheck-a",status="error",type="healthz"} 1
4646
`
@@ -57,10 +57,10 @@ func TestObserveHealthcheck(t *testing.T) {
5757
hcType: "healthz",
5858
hcStatus: Success,
5959
want: `
60-
# HELP kubernetes_healthcheck [BETA] This metric records the result of a single healthcheck.
60+
# HELP kubernetes_healthcheck [STABLE] This metric records the result of a single healthcheck.
6161
# TYPE kubernetes_healthcheck gauge
6262
kubernetes_healthcheck{name="healthcheck-a",type="healthz"} 1
63-
# HELP kubernetes_healthchecks_total [BETA] This metric records the results of all healthcheck.
63+
# HELP kubernetes_healthchecks_total [STABLE] This metric records the results of all healthcheck.
6464
# TYPE kubernetes_healthchecks_total counter
6565
kubernetes_healthchecks_total{name="healthcheck-a",status="error",type="healthz"} 1
6666
kubernetes_healthchecks_total{name="healthcheck-a",status="success",type="healthz"} 1

test/instrumentation/testdata/stable-metrics-list.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,6 @@
9696
labels:
9797
- name
9898
- stage
99-
- name: healthcheck
100-
namespace: kubernetes
101-
help: This metric records the result of a single healthcheck.
102-
type: Gauge
103-
stabilityLevel: BETA
104-
labels:
105-
- name
106-
- type
107-
- name: healthchecks_total
108-
namespace: kubernetes
109-
help: This metric records the results of all healthcheck.
110-
type: Counter
111-
stabilityLevel: BETA
112-
labels:
113-
- name
114-
- status
115-
- type
11699
- name: registered_metrics_total
117100
help: The count of registered metrics broken by stability level and deprecation
118101
version.
@@ -446,6 +429,23 @@
446429
- priority
447430
- resource
448431
- unit
432+
- name: healthcheck
433+
namespace: kubernetes
434+
help: This metric records the result of a single healthcheck.
435+
type: Gauge
436+
stabilityLevel: STABLE
437+
labels:
438+
- name
439+
- type
440+
- name: healthchecks_total
441+
namespace: kubernetes
442+
help: This metric records the results of all healthcheck.
443+
type: Counter
444+
stabilityLevel: STABLE
445+
labels:
446+
- name
447+
- status
448+
- type
449449
- name: evictions_total
450450
subsystem: node_collector
451451
help: Number of Node evictions that happened since current instance of NodeController

0 commit comments

Comments
 (0)