Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
Middleware returns a new negroni middleware handler for tracing requests and reporting errors.
This middleware will recover and report panics, so it can be used instead of the standard negroni.Recovery middleware.
By default, the middleware will use apm.DefaultTracer(). Use WithTracer to specify an alternative tracer.
Types ¶
type Option ¶
type Option apmhttp.ServerOption
Option sets options for tracing.
func WithPanicPropagation ¶
func WithPanicPropagation() Option
WithPanicPropagation returns a Option which enable panic propagation. Any panic will be recovered and recorded as an error in a transaction, then panic will be caused again.
func WithRecovery ¶
func WithRecovery(r RecoveryFunc) Option
WithRecovery returns a Option which sets r as the recovery function to use for tracing server requests.
func WithServerRequestIgnorer ¶
func WithServerRequestIgnorer(r RequestIgnorerFunc) Option
WithServerRequestIgnorer returns a Option which sets r as the function to use to determine whether or not a server request should be ignored. If r is nil, all requests will be reported.
func WithServerRequestName ¶
func WithServerRequestName(r RequestNameFunc) Option
WithServerRequestName returns a Option which sets r as the function to use to obtain the transaction name for the given server request.
func WithTracer ¶
func WithTracer(t *apm.Tracer) Option
WithTracer returns a Option which sets t as the tracer to use for tracing server requests.
type RecoveryFunc ¶
type RecoveryFunc apmhttp.RecoveryFunc
RecoveryFunc is the type of a function for use in WithRecovery.
type RequestIgnorerFunc ¶
type RequestIgnorerFunc apmhttp.RequestIgnorerFunc
RequestIgnorerFunc is the type of a function for use in WithServerRequestIgnorer.
type RequestNameFunc ¶
type RequestNameFunc apmhttp.RequestNameFunc
RequestNameFunc is the type of a function for use in WithServerRequestName.