apmfiber

package module
v2.0.0-...-8b7d6bd Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package apmfiber provides a tracing middleware for fasthttp-based server framework Fiber.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

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

Middleware returns a new Fiber middleware handler for tracing requests and reporting errors.

This middleware will recover and report panics, so it can be used instead of default recover middleware.

By default, the middleware will use apm.DefaultTracer(). Use WithTracer to specify an alternative tracer. Use WithPanicPropagation to disable panic recover.

Types

type Option

type Option func(*middleware)

Option sets options for tracing.

func WithPanicPropagation

func WithPanicPropagation() Option

WithPanicPropagation returns an 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 WithRequestIgnorer

func WithRequestIgnorer(fn apmfasthttp.RequestIgnorerFunc) Option

WithRequestIgnorer returns an Option which sets fn as the function to use to determine whether or not a request should be ignored. If fn is nil, using default RequestIgnorerFunc.

func WithTracer

func WithTracer(t *apm.Tracer) Option

WithTracer returns an Option which sets t as the tracer to use for tracing server requests. If t is nil, using default tracer.

Jump to

Keyboard shortcuts

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