core/corehttp: wrap hostname option with otelhttp
Henrique Dias committed
Jan 16, 2024 at 10:56 UTC
0ec6308e8bf2c18991de7ec0da68bfe6f20ec239
1 file changed
+6
-1
core/corehttp/gateway.go
+6
-1
@@ -62,7 +62,12 @@ func HostnameOption() ServeOption {
62
}
63
64
childMux := http.NewServeMux()
65
- mux.Handle("/", gateway.NewHostnameHandler(config, backend, childMux))
65
+
66
+ var handler http.Handler
67
+ handler = gateway.NewHostnameHandler(config, backend, childMux)
68
+ handler = otelhttp.NewHandler(handler, "HostnameGateway")
69
+
70
+ mux.Handle("/", handler)
71
return childMux, nil
72
}
73
}