From e8ecb4d1e708db08960afb32e7d92f54a2ef981b Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Tue, 16 Jan 2024 10:56:00 +0100 Subject: [PATCH] core/corehttp: wrap hostname option with otelhttp --- core/corehttp/gateway.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/corehttp/gateway.go b/core/corehttp/gateway.go index a2567d8f0fd..a1576517697 100644 --- a/core/corehttp/gateway.go +++ b/core/corehttp/gateway.go @@ -62,7 +62,12 @@ func HostnameOption() ServeOption { } childMux := http.NewServeMux() - mux.Handle("/", gateway.NewHostnameHandler(config, backend, childMux)) + + var handler http.Handler + handler = gateway.NewHostnameHandler(config, backend, childMux) + handler = otelhttp.NewHandler(handler, "HostnameGateway") + + mux.Handle("/", handler) return childMux, nil } }