From 0ec6308e8bf2c18991de7ec0da68bfe6f20ec239 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 a2567d8f0..a15765176 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 } }