Documentation ¶
Overview ¶
Package apmatreugo provides a factory to create the tracing middleware and panic view for atreugo server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory is a factory to create the tracing middleware and panic view.
func (*Factory) Middleware ¶
func (f *Factory) Middleware() atreugo.Middleware
Middleware returns a middleware.
type Option ¶
type Option func(*Factory)
Option sets options for tracing requests.
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(fn RequestIgnorerFunc) Option
WithServerRequestIgnorer returns a Option which sets fn as the function to use to determine whether or not a server request should be ignored. If request ignorer is nil, all requests will be reported.
func WithServerRequestName ¶
func WithServerRequestName(fn RequestNameFunc) Option
WithServerRequestName returns a Option which sets fn 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 func(ctx *atreugo.RequestCtx, tx *apm.Transaction, bc *apm.BodyCapturer, recovered interface{})
RecoveryFunc is the type of a function for use in WithRecovery.
type RequestIgnorerFunc ¶
type RequestIgnorerFunc func(*atreugo.RequestCtx) bool
RequestIgnorerFunc is the type of a function for use in WithServerRequestIgnorer.
type RequestNameFunc ¶
type RequestNameFunc func(*atreugo.RequestCtx) string
RequestNameFunc is the type of a function for use in WithServerRequestName.