Documentation ¶
Index ¶
- func ContextWithSpan(ctx context.Context, span opentracing.Span) context.Context
- func FromIncomingContext(ctx context.Context) opentracing.StartSpanOption
- func HeaderExtractor(carrier http.Header) opentracing.StartSpanOption
- func HeaderInjector(ctx context.Context, carrier http.Header) context.Context
- func MetadataInjector(ctx context.Context, md metadata.MD) context.Context
- func SetGlobalTracer(tracer opentracing.Tracer)
- func SpanFromContext(ctx context.Context) opentracing.Span
- func StartSpanFromContext(ctx context.Context, op string, opts ...opentracing.StartSpanOption) (opentracing.Span, context.Context)
- func TraceID(ctx context.Context) string
- type CarrierMD
- type NullStartSpanOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithSpan ¶ added in v1.1.0
ContextWithSpan return a new `context.Context` that holds a reference to the span
func FromIncomingContext ¶
func FromIncomingContext(ctx context.Context) opentracing.StartSpanOption
FromIncomingContext extract trace info from span
func HeaderExtractor ¶
func HeaderExtractor(carrier http.Header) opentracing.StartSpanOption
HeaderExtractor extract trace info from span
func HeaderInjector ¶ added in v1.3.0
HeaderInjector inject trace info to span
func MetadataInjector ¶
MetadataInjector inject trace info to span
func SetGlobalTracer ¶
func SetGlobalTracer(tracer opentracing.Tracer)
SetGlobalTracer set global trace instance
func SpanFromContext ¶
func SpanFromContext(ctx context.Context) opentracing.Span
SpanFromContext return the span attached to current context
func StartSpanFromContext ¶
func StartSpanFromContext(ctx context.Context, op string, opts ...opentracing.StartSpanOption) (opentracing.Span, context.Context)
StartSpanFromContext start a span from current context
Types ¶
type CarrierMD ¶ added in v1.3.0
type CarrierMD struct {
// contains filtered or unexported fields
}
func (CarrierMD) ForeachKey ¶ added in v1.3.0
ForeachKey returns TextMap contents via repeated calls to the `handler` function. If any call to `handler` returns a non-nil error, ForeachKey terminates and returns that error.
type NullStartSpanOption ¶
type NullStartSpanOption struct{}
func (NullStartSpanOption) Apply ¶
func (n NullStartSpanOption) Apply(options *opentracing.StartSpanOptions)
Click to show internal directories.
Click to hide internal directories.