Skip to content

Commit

Permalink
Merge pull request #638 from KubeKyrie/fix-otel-trace
Browse files Browse the repository at this point in the history
fix otel trace handler WithTracing, use another func
  • Loading branch information
Iceber authored Jan 30, 2024
2 parents 209eb4d + 5b8ea40 commit 1bc7cf6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/kubeapiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"k8s.io/apiserver/pkg/server/healthz"
utilfeature "k8s.io/apiserver/pkg/util/feature"
"k8s.io/client-go/restmapper"
"k8s.io/component-base/tracing"

informers "github.com/clusterpedia-io/clusterpedia/pkg/generated/informers/externalversions"
"github.com/clusterpedia-io/clusterpedia/pkg/kubeapiserver/discovery"
Expand Down Expand Up @@ -148,7 +149,7 @@ func BuildHandlerChain(apiHandler http.Handler, c *genericapiserver.Config) http
handler = filters.RemoveFieldSelectorFromRequest(handler)

if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIServerTracing) {
handler = genericapifilters.WithTracing(handler, c.TracerProvider)
handler = tracing.WithTracing(handler, c.TracerProvider, "ClusterpediaAPI")
}

/* used for debugging
Expand Down

0 comments on commit 1bc7cf6

Please sign in to comment.