Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnEventMiddleware ¶
func OnEventMiddleware(tracer opentracing.Tracer, logger trace.Logger, options ...Option) geb.Middleware
OnEventMiddleware return middleware which will extract the trace context from event 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 related tags. If an error happens or one of the middleware panics, it will mark the span as failed and continue panicking.
func PublishMiddleware ¶
func PublishMiddleware(tracer opentracing.Tracer, logger trace.Logger, options ...Option) geb.Middleware
PublishMiddleware return middleware which will extract the trace context from event 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. It will also add correlation related tags. 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 OnEventMiddleware 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.