Back to

Package jaegertracing

Latest Go to latest

The highest tagged major version is .

Published: Oct 15, 2019 | License: MIT | Module:


Package jaegertracing provides middleware to Opentracing using Jaeger.

Example: ``` package main import (


) func main() {

e := echo.New()
// Enable tracing middleware
c := jaegertracing.New(e, nil)
defer c.Close()


} ```



var (
	// DefaultTraceConfig is the default Trace middleware config.
	DefaultTraceConfig = TraceConfig{
		Skipper: middleware.DefaultSkipper,
		// contains filtered or unexported fields

func CreateChildSpan

func CreateChildSpan(ctx echo.Context, name string) opentracing.Span

CreateChildSpan creates a new opentracing span adding tags for the span name and caller details. User must call defer `sp.Finish()`

func New

func New(e *echo.Echo, skipper middleware.Skipper) io.Closer

New creates an Opentracing tracer and attaches it to Echo middleware. Returns Closer do be added to caller function as `defer closer.Close()`

func Trace

func Trace(tracer opentracing.Tracer) echo.MiddlewareFunc

Trace returns a Trace middleware.

Trace middleware traces http requests and reporting errors.

func TraceFunction

func TraceFunction(ctx echo.Context, fn interface{}, params ...interface{}) (result []reflect.Value)

TraceFunction wraps funtion with opentracing span adding tags for the function name and caller details

func TraceWithConfig

func TraceWithConfig(config TraceConfig) echo.MiddlewareFunc

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

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
	// contains filtered or unexported fields

TraceConfig defines the config for Trace middleware.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier