Back to godoc.org

Package jaegertracing

v0.6.1-0...-f4ded4a
Latest Go to latest

The highest tagged major version is .

Published: Oct 15, 2019 | License: MIT | Module: github.com/3CLogicInc/echo-contrib

Overview

Package jaegertracing provides middleware to Opentracing using Jaeger.

Example: ``` package main import (

"github.com/labstack/echo-contrib/jaegertracing"
"github.com/labstack/echo/v4"

) func main() {

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

e.Logger.Fatal(e.Start(":1323"))

} ```

Index

Variables

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