tracing

package
v0.0.0-...-6999b08 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const TiDBTrace = "tr"

TiDBTrace is set as Baggage on traces which are used for tidb tracing.

Variables

This section is empty.

Functions

func ChildSpanFromContxt

func ChildSpanFromContxt(ctx context.Context, opName string) (opentracing.Span, context.Context)

ChildSpanFromContxt return a non-nil span. If span can be got from ctx, then returned span is a child of such span. Otherwise, returned span is a noop span.

func NewRecordedTrace

func NewRecordedTrace(opName string, callback func(sp basictracer.RawSpan)) opentracing.Span

NewRecordedTrace returns a Span which records directly via the specified callback.

func SpanFromContext

func SpanFromContext(ctx context.Context) (sp opentracing.Span)

SpanFromContext returns the span obtained from the context or, if none is found, a new one started through tracer.

Types

type CallbackRecorder

type CallbackRecorder func(sp basictracer.RawSpan)

A CallbackRecorder immediately invokes itself on received trace spans.

func (CallbackRecorder) RecordSpan

func (cr CallbackRecorder) RecordSpan(sp basictracer.RawSpan)

RecordSpan implements basictracer.SpanRecorder.

Jump to

Keyboard shortcuts

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