tracing

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultTraceConfig is the default Trace middleware config.
	DefaultTraceConfig = TraceConfig{
		Skipper:       middleware.DefaultSkipper,
		ComponentName: defaultComponentName,
		IsBodyDump:    false,
	}
)

Functions

func Tag

func Tag(ctx context.Context, key string, val interface{})

func Trace

func Trace(tracer opentracing.Tracer) echo.MiddlewareFunc

Trace returns a Trace middleware. Trace middleware traces http requests and reporting errors.

func TraceWithConfig

func TraceWithConfig(config TraceConfig) echo.MiddlewareFunc

TraceWithConfig returns a Trace middleware with config. See: `Trace()`.

Types

type TraceConfig

type TraceConfig struct {
	// Skipper defines a function to skip middleware.
	Skipper middleware.Skipper

	// OpenTracing Tracer instance which should be got before
	Tracer opentracing.Tracer

	// ComponentName used for describing the tracing component name
	ComponentName string

	// add req body & resp body to tracing tags
	IsBodyDump bool
}

TraceConfig defines the config for Trace middleware.

Jump to

Keyboard shortcuts

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