apmhttprouter

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(h httprouter.Handle, route string, o ...Option) httprouter.Handle

Wrap wraps h such that it will report requests as transactions to Elastic APM, using route in the transaction name.

By default, the returned Handle will use elasticapm.DefaultTracer. Use WithTracer to specify an alternative tracer.

By default, the returned Handle will recover panics, reporting them to the configured tracer. To override this behaviour, use WithRecovery.

Types

type Option

type Option func(*options)

Option sets options for tracing.

func WithRecovery

func WithRecovery(r apmhttp.RecoveryFunc) Option

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

func WithTracer

func WithTracer(t *elasticapm.Tracer) Option

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

Jump to

Keyboard shortcuts

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