gebtrace

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 7 Imported by: 0

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.

func Trace

func Trace(option trace.Option) (Option, error)

Trace option can be passed to Middleware to handle cases when a parent trace not found. Check the possible options for more information.

Jump to

Keyboard shortcuts

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