@@ -35,6 +35,8 @@ import (
3535 "k8s.io/apimachinery/pkg/util/wait"
3636
3737 // Injection related imports.
38+ "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp"
39+
3840 network "knative.dev/networking/pkg"
3941 netcfg "knative.dev/networking/pkg/config"
4042 netprobe "knative.dev/networking/pkg/http/probe"
@@ -230,7 +232,7 @@ func main() {
230232 apiconfig .DefaultRevisionIdleTimeoutSeconds * time .Second
231233 })
232234 ah = concurrencyReporter .Handler (ah )
233- ah = activatorhandler .NewTracingHandler (tp , ah )
235+ ah = activatorhandler .NewTracingAttributeHandler (tp , ah )
234236 reqLogHandler , err := pkghttp .NewRequestLogHandler (ah , logging .NewSyncFileWriter (os .Stdout ), "" ,
235237 requestLogTemplateInputGetter , false /*enableProbeRequestLog*/ )
236238 if err != nil {
@@ -240,11 +242,16 @@ func main() {
240242
241243 // NOTE: MetricHandler is being used as the outermost handler of the meaty bits. We're not interested in measuring
242244 // the healthchecks or probes.
243- ah = activatorhandler .NewMetricHandler (env .PodName , ah )
245+ ah = activatorhandler .NewMetricAttributeHandler (env .PodName , ah )
244246 // We need the context handler to run first so ctx gets the revision info.
245247 ah = activatorhandler .WrapActivatorHandlerWithFullDuplex (ah , logger )
246248 ah = activatorhandler .NewContextHandler (ctx , ah , configStore )
247249
250+ ah = otelhttp .NewHandler (ah , "handle" ,
251+ otelhttp .WithTracerProvider (tp ),
252+ otelhttp .WithMeterProvider (mp ),
253+ )
254+
248255 // Network probe handlers.
249256 ah = & activatorhandler.ProbeHandler {NextHandler : ah }
250257 ah = netprobe .NewHandler (ah )
0 commit comments