Documentation ¶
Index ¶
- Constants
- func ContextWithSpan(ctx context.Context, span opentracing.Span) context.Context
- func Extract(format, carrier interface{}) opentracing.SpanContext
- func Inject(sc opentracing.SpanContext, format, carrier interface{})
- func SetTracer(t opentracing.Tracer)
- func SpanFromContext(ctx context.Context) opentracing.Span
- func StartChild(parent opentracing.Span, operation string) (span opentracing.Span)
- func StartChildFromContext(ctx context.Context, operation string, opts ...opentracing.StartSpanOption) (span opentracing.Span)
- func StartFollow(follow opentracing.Span, operation string) (span opentracing.Span)
- func StartServer(operation string, format, carrier interface{}) opentracing.Span
- func StartSpan(operation string, opts ...opentracing.StartSpanOption) opentracing.Span
- type HTTPHeadersCarrier
- type Span
- type StartSpanOption
- type TextMapCarrier
- type Tracer
- func (t *Tracer) Extract(format, carrier interface{}) opentracing.SpanContext
- func (t *Tracer) Inject(sc opentracing.SpanContext, format, carrier interface{})
- func (t *Tracer) StartChild(parent opentracing.Span, operation string) opentracing.Span
- func (t *Tracer) StartChildFromContext(ctx context.Context, operation string, opts ...opentracing.StartSpanOption) opentracing.Span
- func (t *Tracer) StartFollow(follow opentracing.Span, operation string) opentracing.Span
- func (t *Tracer) StartServer(operation string, format, carrier interface{}) opentracing.Span
Constants ¶
const ( PkgName = "auxo.apm.trace" Binary = opentracing.Binary TextMap = opentracing.TextMap HTTPHeaders = opentracing.HTTPHeaders )
Variables ¶
This section is empty.
Functions ¶
func ContextWithSpan ¶
func SpanFromContext ¶
func StartChild ¶
func StartChild(parent opentracing.Span, operation string) (span opentracing.Span)
func StartChildFromContext ¶
func StartChildFromContext(ctx context.Context, operation string, opts ...opentracing.StartSpanOption) (span opentracing.Span)
StartChildFromContext starts and returns a Span with `operation`, using any Span found within `ctx` as a ChildOfRef. If no such parent could be found, StartChildFromContext creates a root (parentless) Span.
Example usage:
SomeFunction(ctx context.Context, ...) { sp := trace.StartChildFromContext(ctx, "SomeFunction") defer sp.Finish() ... }
func StartFollow ¶
func StartFollow(follow opentracing.Span, operation string) (span opentracing.Span)
func StartServer ¶
func StartServer(operation string, format, carrier interface{}) opentracing.Span
StartServer extracts SpanContext from carrier, then starts and returns a server Span with `operation`, using any Span found within `SpanContext` as a ChildOfRef. If no such parent could be found, StartChildFromContext creates a root (parentless) Span.
Example usage:
SomeFunction(ctx context.Context, ...) { sp := trace.StartServer("SomeFunction", trace.HTTPHeaders, opentracing.HTTPHeadersCarrier(r.Header)) defer sp.Finish() ... }
Types ¶
type HTTPHeadersCarrier ¶
type HTTPHeadersCarrier = opentracing.HTTPHeadersCarrier
type StartSpanOption ¶
type StartSpanOption = opentracing.StartSpanOption
type TextMapCarrier ¶
type TextMapCarrier = opentracing.TextMapCarrier
type Tracer ¶
type Tracer struct { opentracing.Tracer // contains filtered or unexported fields }
func (*Tracer) Extract ¶
func (t *Tracer) Extract(format, carrier interface{}) opentracing.SpanContext
Extract() returns a SpanContext instance given `format` and `carrier`. If there was simply no SpanContext to extract or errors occurred, Extract() returns nil.
func (*Tracer) Inject ¶
func (t *Tracer) Inject(sc opentracing.SpanContext, format, carrier interface{})
func (*Tracer) StartChild ¶
func (*Tracer) StartChildFromContext ¶
func (t *Tracer) StartChildFromContext(ctx context.Context, operation string, opts ...opentracing.StartSpanOption) opentracing.Span
StartChildFromContext starts and returns a Span with `operation`, using any Span found within `ctx` as a ChildOfRef. If no such parent could be found, StartChildFromContext creates a root (parentless) Span.
Example usage:
SomeFunction(ctx context.Context, ...) { sp := trace.StartChildFromContext(ctx, "SomeFunction") defer sp.Finish() ... }
func (*Tracer) StartFollow ¶
func (*Tracer) StartServer ¶
StartServer extracts SpanContext from carrier, then starts and returns a server Span with `operation`, using any Span found within `SpanContext` as a ChildOfRef. If no such parent could be found, StartChildFromContext creates a root (parentless) Span.
Example usage:
SomeFunction(ctx context.Context, ...) { sp := trace.StartServer("SomeFunction", trace.HTTPHeaders, opentracing.HTTPHeadersCarrier(r.Header)) defer sp.Finish() ... }