Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
k8s.io/client-go v0.35.2
knative.dev/eventing v0.48.1-0.20260316031422-ce3fe6b62f97
knative.dev/hack v0.0.0-20260310014051-c448fdb867e2
knative.dev/pkg v0.0.0-20260316154451-5d1c12d99335
knative.dev/pkg v0.0.0-20260317082650-91e176852006
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ knative.dev/eventing v0.48.1-0.20260316031422-ce3fe6b62f97 h1:igxNyYW2+LxPspTqGp
knative.dev/eventing v0.48.1-0.20260316031422-ce3fe6b62f97/go.mod h1:UR5qyT/4a68s4HJ+ZEourVWJ7pS7um8PCW4COjeOyxE=
knative.dev/hack v0.0.0-20260310014051-c448fdb867e2 h1:b35SGLEp03D8oGf8mE9HBt3yfNgYpAK0fw46hFXs9w4=
knative.dev/hack v0.0.0-20260310014051-c448fdb867e2/go.mod h1:L5RzHgbvam0u8QFHfzCX6MKxu/a/gIGEdaRBqNiVbl0=
knative.dev/pkg v0.0.0-20260316154451-5d1c12d99335 h1:OpR5LNa0m34T8KOzGLwObjmMkxuuenSFU51oiNcfKRw=
knative.dev/pkg v0.0.0-20260316154451-5d1c12d99335/go.mod h1:o/XS1E/hYh9IR8deEEiJG4kKtQfqnf9Gwt5bwp2x4AU=
knative.dev/pkg v0.0.0-20260317082650-91e176852006 h1:kigmOSaEWOddCfoyH1+Mx0w1kwnZrl3CbPAN+9/+Kx4=
knative.dev/pkg v0.0.0-20260317082650-91e176852006/go.mod h1:o/XS1E/hYh9IR8deEEiJG4kKtQfqnf9Gwt5bwp2x4AU=
sigs.k8s.io/gateway-api v1.1.0 h1:DsLDXCi6jR+Xz8/xd0Z1PYl2Pn0TyaFMOPPZIj4inDM=
sigs.k8s.io/gateway-api v1.1.0/go.mod h1:ZH4lHrL2sDi0FHZ9jjneb8kKnGzFWyrTya35sWUTrRs=
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
Expand Down
24 changes: 14 additions & 10 deletions vendor/knative.dev/pkg/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"knative.dev/pkg/observability/semconv"

"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/trace"
Expand Down Expand Up @@ -313,19 +312,11 @@ func (wh *Webhook) Run(stop <-chan struct{}) error {
}

otelHandler := otelhttp.NewHandler(
drainer,
&routeLabeler{next: drainer},
wh.Options.ServiceName, // Note this service is k8s service name
otelhttp.WithMeterProvider(wh.Options.MeterProvider),
otelhttp.WithTracerProvider(wh.Options.TracerProvider),
otelhttp.WithPropagators(wh.Options.TextMapPropagator),
otelhttp.WithMetricAttributesFn(func(r *http.Request) []attribute.KeyValue {
if r.URL.Path == "" {
return nil
}
return []attribute.KeyValue{
semconv.HTTPRoute(r.URL.Path),
}
}),
otelhttp.WithFilter(func(r *http.Request) bool {
// Don't trace kubelet probes
return !network.IsKubeletProbe(r)
Expand Down Expand Up @@ -406,3 +397,16 @@ func (wh *Webhook) ServeHTTP(w http.ResponseWriter, r *http.Request) {

wh.mux.ServeHTTP(w, r)
}

type routeLabeler struct {
next http.Handler
}

func (rl *routeLabeler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "" {
labeler, _ := otelhttp.LabelerFromContext(r.Context())
labeler.Add(semconv.HTTPRoute(r.URL.Path))
}

rl.next.ServeHTTP(w, r)
}
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ knative.dev/eventing/pkg/utils
# knative.dev/hack v0.0.0-20260310014051-c448fdb867e2
## explicit; go 1.24
knative.dev/hack
# knative.dev/pkg v0.0.0-20260316154451-5d1c12d99335
# knative.dev/pkg v0.0.0-20260317082650-91e176852006
## explicit; go 1.25.0
knative.dev/pkg/apis
knative.dev/pkg/apis/duck
Expand Down
Loading