apm-agent-go: github.com/elastic/apm-agent-go/module/apmnegroni Index | Files

package apmnegroni

import "github.com/elastic/apm-agent-go/module/apmnegroni"

Index

Package Files

middleware.go

func Middleware Uses

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.

type Option Uses

type Option apmhttp.ServerOption

Option sets options for tracing.

func WithPanicPropagation Uses

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 Uses

func WithRecovery(r RecoveryFunc) Option

WithRecovery returns a Option which sets r as the recovery function to use for tracing server requests.

func WithServerRequestIgnorer Uses

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 Uses

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 Uses

func WithTracer(t *apm.Tracer) Option

WithTracer returns a Option which sets t as the tracer to use for tracing server requests.

type RecoveryFunc Uses

type RecoveryFunc apmhttp.RecoveryFunc

RecoveryFunc is the type of a function for use in WithRecovery.

type RequestIgnorerFunc Uses

type RequestIgnorerFunc apmhttp.RequestIgnorerFunc

RequestIgnorerFunc is the type of a function for use in WithServerRequestIgnorer.

type RequestNameFunc Uses

type RequestNameFunc apmhttp.RequestNameFunc

RequestNameFunc is the type of a function for use in WithServerRequestName.

Package apmnegroni imports 6 packages (graph). Updated 2020-08-07. Refresh now. Tools for package owners.