Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
Handler wraps an http.Handler with tracing using the given service and resource. If the WithResourceNamer option is provided as part of opts, it will take precedence over the resource argument.
func TraceAndServe ¶
func TraceAndServe(h http.Handler, w http.ResponseWriter, r *http.Request, cfg *httptrace.ServeConfig)
TraceAndServe serves the handler h using the given ResponseWriter and Request, applying tracing according to the specified config.
Types ¶
type ServeMux ¶
ServeMux is an HTTP request multiplexer that traces all the incoming requests.
func NewServeMux ¶
NewServeMux allocates and returns an http.ServeMux augmented with the global tracer.
func (*ServeMux) ServeHTTP ¶
func (mux *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP dispatches the request to the handler whose pattern most closely matches the request URL. We only need to rewrite this function to be able to trace all the incoming requests to the underlying multiplexer
type WrappedHandler ¶
type WrappedHandler struct {
http.HandlerFunc
}