Documentation
¶
Index ¶
- func InitGlobalTracer(name string, jaegerCfg *config.JaegerConfig) (io.Closer, error)
- func SetGlob(t Tracer)
- type JaegerTracer
- func (t *JaegerTracer) InitGlobalTracer(name string, cfg *config.JaegerConfig) (io.Closer, error)
- func (*JaegerTracer) IsEnabled() bool
- func (t JaegerTracer) StartSpanFromContext(ctx context.Context, opName string) (opentracing.Span, context.Context)
- func (t JaegerTracer) StartSpanFromRequestHeader(ctx context.Context, opName string, header http.Header) (opentracing.Span, context.Context)
- type NopTracer
- func (*NopTracer) InitGlobalTracer(_ string, _ *config.JaegerConfig) (io.Closer, error)
- func (*NopTracer) IsEnabled() bool
- func (*NopTracer) StartSpanFromContext(ctx context.Context, _ string) (opentracing.Span, context.Context)
- func (*NopTracer) StartSpanFromRequestHeader(ctx context.Context, _ string, _ http.Header) (opentracing.Span, context.Context)
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGlobalTracer ¶
InitGlobalTracer creates a new Jaeger tracer, and sets it as global tracer.
Types ¶
type JaegerTracer ¶
type JaegerTracer struct {
// contains filtered or unexported fields
}
JaegerTracer implements the Tracer interface using the jaeger client library
func (*JaegerTracer) InitGlobalTracer ¶
func (t *JaegerTracer) InitGlobalTracer(name string, cfg *config.JaegerConfig) (io.Closer, error)
InitGlobalTracer creates a global tracer using the Jaeger client
func (*JaegerTracer) IsEnabled ¶
func (*JaegerTracer) IsEnabled() bool
IsEnabled satisfies the Tracer interface, always returning true
func (JaegerTracer) StartSpanFromContext ¶
func (t JaegerTracer) StartSpanFromContext( ctx context.Context, opName string, ) (opentracing.Span, context.Context)
StartSpanFromContext attempts to extract span info from the given context.Context and creates a new / child span accordingly, which is associated to the same context object.
func (JaegerTracer) StartSpanFromRequestHeader ¶
func (t JaegerTracer) StartSpanFromRequestHeader( ctx context.Context, opName string, header http.Header, ) (opentracing.Span, context.Context)
StartSpanFromRequestHeader attempts to extract span info from the request header and creates a new / child span accordingly, which is associated to the given context.Context object.
type NopTracer ¶
type NopTracer struct{}
NopTracer implements the Tracer interface with dummy methods
func (*NopTracer) InitGlobalTracer ¶
InitGlobalTracer satisfies the Tracer interface and returns a Nop closer
type Tracer ¶
type Tracer interface { InitGlobalTracer(string, *config.JaegerConfig) (io.Closer, error) IsEnabled() bool StartSpanFromRequestHeader( context.Context, string, http.Header, ) (opentracing.Span, context.Context) StartSpanFromContext(context.Context, string) (opentracing.Span, context.Context) }
Tracer represents a generic tracer that supports initialization of a global tracing client and creation of opentracing spans