Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TraceHandler ¶
TraceHandler is a mux.MiddlewareFunc which creates a span with the route's name, as set by (mux.*Route).Name(), embeds it in the request context, and invokes the next middleware in the chain.
It also annotates the span with the route_path_template, if it exists, and the route_uri. To add additional spans, extract the span in your VTAdminHTTPHandler like:
func Handler(ctx context.Context, r Request, api *API) *JSONResponse { span, _ := trace.FromContext(ctx) span.Annotate("foo", "bar") return NewJSONResponse(api.Something(ctx)) }
An unnamed route will get a span named "vtadmin:http:<unnamed route>".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.