tracing

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 11 Imported by: 0

README

tracing

docker run -d -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one:latest

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultSkipper added in v0.0.9

func DefaultSkipper(r *http.Request) bool

func GetRequestIDFromContext added in v0.0.3

func GetRequestIDFromContext(ctx context.Context) string

Get request id from context which set by middleware

func JaegerTracer added in v0.2.0

func JaegerTracer(serviceName string) (opentracing.Tracer, io.Closer, error)

Get tracer with default configuration if environment not found. https://github.com/jaegertracing/jaeger-client-go#environment-variables

func OpentracingMiddleware added in v0.1.0

func OpentracingMiddleware() func(http.Handler) http.Handler

Get middleware with default config

func OpentracingMiddlewareWithConfig added in v0.1.0

func OpentracingMiddlewareWithConfig(cfg *MiddlewareConfig) func(http.Handler) http.Handler

Get middleware with config

func SetTracingHeader added in v0.0.9

func SetTracingHeader(req *http.Request, ctx context.Context, span opentracing.Span)

Carries span and request-id to request header

func SetTracingHeaderWithConfig added in v0.2.0

func SetTracingHeaderWithConfig(req *http.Request, ctx context.Context, span opentracing.Span, cfg *Config)

Carries span and request-id to request header with custom configuration

Types

type Config added in v0.0.9

type Config struct {
	Tracer             opentracing.Tracer
	RequestIDHeaderKey string
}

func DefaultTracerConfig added in v0.2.0

func DefaultTracerConfig() *Config

type MiddlewareConfig added in v0.0.9

type MiddlewareConfig struct {
	Tracer             opentracing.Tracer
	RequestIDHeaderKey string
	UserIDHeaderKey    string
	Skipper            func(r *http.Request) bool
	LogHeaderKeys      []string
	LogCookieKeys      []string
}

func DefaultMiddlewareConfig added in v0.2.0

func DefaultMiddlewareConfig() *MiddlewareConfig

Jump to

Keyboard shortcuts

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