tracing

package
v2.8.18 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 19 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 Inject added in v2.7.3

func Inject(ctx context.Context, h *http.Header)

func Tag

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

func Trace

func Trace(ctx context.Context, name string) (context.Context, func(err error, logs ...log.Field) error)

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