apmnegroni

package module
v2.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(o ...Option) negroni.Handler

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL