kubelet-tracing:update

Signed-off-by: Sally O'Malley <somalley@redhat.com>
This commit is contained in:
Sally O'Malley 2022-07-11 20:49:52 -04:00
parent 5b4456ceea
commit 7585aae1b4
Failed to extract signature
3 changed files with 8 additions and 4 deletions

View File

@ -63,8 +63,8 @@ import (
"k8s.io/component-base/logs"
compbasemetrics "k8s.io/component-base/metrics"
"k8s.io/component-base/metrics/legacyregistry"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
tracing "k8s.io/component-base/tracing"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1"
podresourcesapi "k8s.io/kubelet/pkg/apis/podresources/v1"
podresourcesapiv1alpha1 "k8s.io/kubelet/pkg/apis/podresources/v1alpha1"
"k8s.io/kubernetes/pkg/api/legacyscheme"
@ -135,7 +135,9 @@ type filteringContainer struct {
}
func (a *filteringContainer) Handle(path string, handler http.Handler) {
handler = tracing.WithTracing(handler, a.TracerProvider, "kubelet")
if utilfeature.DefaultFeatureGate.Enabled(features.KubeletTracing) {
handler = tracing.WithTracing(handler, a.TracerProvider, "kubelet")
}
a.HandleWithFilter(path, handler)
a.registeredHandlePaths = append(a.registeredHandlePaths, path)
}

View File

@ -1,7 +1,9 @@
# See the OWNERS docs at https://go.k8s.io/owners
options:
no_parent_owners: true
approvers:
- sig-instrumentation-approvers
- api-approvers
reviewers:
- sig-instrumentation-reviewers
labels:

View File

@ -1,5 +1,5 @@
/*
Copyright 2018 The Kubernetes Authors.
Copyright 2022 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.