github.com/safedep/dry@v0.0.0-20241016050132-a15651f0548b/obs/http.go (about) 1 package obs 2 3 import ( 4 "net/http" 5 6 "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" 7 ) 8 9 func WrapHttpHandler(handler http.Handler, operation string, 10 options ...otelhttp.Option) http.Handler { 11 options = append(options, otelhttp.WithMessageEvents(otelhttp.ReadEvents, otelhttp.WriteEvents)) 12 return otelhttp.NewHandler(handler, operation, options...) 13 }