Instrument instruments the mux.Router so that requests are traced.
Instrument installs middleware into r, and alsos overrides r.NotFoundHandler and r.MethodNotAllowedHandler so that they are traced. If you modify either of those fields, you must do so before calling Instrument.
Middleware returns a new gorilla/mux middleware handler for tracing requests and reporting errors.
This middleware will recover and report panics, so it can be used instead of the gorilla/middleware.RecoveryHandler middleware.
Middleware does not get invoked when a route cannot be matched, or when an unsupported method is used. To report transactions in these cases, you should use the Instrument function, or set the router's NotFoundHandler and MethodNotAllowedHandler fields using the Wrap functions in this package.
By default, the middleware will use apm.DefaultTracer. Use WithTracer to specify an alternative tracer.
WrapMethodNotAllowedHandler wraps h with m. If h is nil, then a default handler will be used that returns status code 405.
WrapNotFoundHandler wraps h with m. If h is nil, then http.NotFoundHandler() will be used.
type Option func(*options)
Option sets options for tracing.
WithRequestIgnorer returns a Option which sets r as the function to use to determine whether or not a request should be ignored. If r is nil, all requests will be reported.
WithTracer returns an Option which sets t as the tracer to use for tracing server requests.