Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(tracer opentracing.Tracer, logger trace.Logger, options ...Option) echo.MiddlewareFunc
Middleware return middleware which will extract the trace context from headers and starts a new child span. If there's no parent context, it will start a new root span and adds the 'span.missing' tag to the span. If the Start option is passed to the method, it will start a new root span, without adding the 'span.missing' tag. It will also add correlation and http related tags, like the http method, status code etc.. If an error happens or one of the middleware panics, it will mark the span as failed and continue panicking.
Types ¶
type Option ¶
type Option func(*settings)
func GenerateCorrelation ¶
func GenerateCorrelation(gen func() *trace.Correlation) Option
GenerateCorrelation option can be passed to Middleware to generate correlation when it's missing. A generator function is required for generation the Correlation object when starting a trace. Usually just use trace.NewCorrelation.