Documentation ¶
Index ¶
- type Span
- type SpanContext
- type Tracer
- func (tracer *Tracer) Close() error
- func (tracer *Tracer) CurrentSpan() tracing.Span
- func (tracer *Tracer) EmptySpanContext() tracing.SpanContext
- func (tracer *Tracer) Extract(carrier interface{}, format string) (tracing.SpanContext, error)
- func (tracer *Tracer) Flush()
- func (tracer *Tracer) Inject(carrier interface{}, format string) error
- func (tracer *Tracer) InjectContext(carrier interface{}, format string, spanCtx tracing.SpanContext) error
- func (tracer *Tracer) RegisterExtractionFormat(format string, extractor tracing.Extractor)
- func (tracer *Tracer) RegisterInjectionFormat(format string, injector tracing.Injector)
- func (tracer *Tracer) RootSpan() tracing.Span
- func (tracer *Tracer) StartSpan(name string, spanCtx tracing.SpanContext) tracing.Span
- func (tracer *Tracer) UUID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span encapsulates the state of logical operation it represents
func (*Span) Context ¶
func (span *Span) Context() tracing.SpanContext
Context retrieves SpanContext for this Span
func (*Span) Finish ¶
func (span *Span) Finish()
Finish notifies that operation has finished. Span duration is derived by subtracting the start timestamp from this, and set when appropriate.
func (*Span) Log ¶
Log stores structured data. Despite this functionality being outlined in OpenTracing spec it's currently only supported in Jaeger
type SpanContext ¶
type SpanContext struct { }
SpanContext holds the context of a Span. It should be initialized using NewSpanContext method.
func (*SpanContext) RawContext ¶
func (spanCtx *SpanContext) RawContext() interface{}
RawContext returns underlying (original) span context.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is the tracing implementation for Zipkin. It should be initialized using NewTracer method.
func (*Tracer) Close ¶
Close does a clean shutdown of the reporter, sending any traces that may be buffered in memory. This is especially useful for command-line tools that enable tracing, as well as for the long-running apps that support graceful shutdown.
It goes without saying, but you cannot send anymore spans after calling Close, so you should only run this once during the lifecycle of the program.
func (*Tracer) CurrentSpan ¶
func (tracer *Tracer) CurrentSpan() tracing.Span
CurrentSpan retrieves the most recently activated span.
func (*Tracer) EmptySpanContext ¶
func (tracer *Tracer) EmptySpanContext() tracing.SpanContext
EmptySpanContext return empty span context for creating spans
func (*Tracer) Extract ¶
Extract deserializes span context from from a given carrier using the format descriptor that tells tracer how to decode it from the carrier parameters
func (*Tracer) Flush ¶
func (tracer *Tracer) Flush()
Flush may flush any pending spans to the transport and reset the state of the tracer. Make sure this method is always called after the request is finished.
func (*Tracer) Inject ¶
Inject implicitly serializes current span context using the format descriptor that tells how to encode trace info in the carrier parameters
func (*Tracer) InjectContext ¶
func (tracer *Tracer) InjectContext(carrier interface{}, format string, spanCtx tracing.SpanContext) error
InjectContext serializes specified span context into a given carrier using the format descriptor that tells how to encode trace info in the carrier parameters
func (*Tracer) RegisterExtractionFormat ¶
RegisterExtractionFormat register extractor implementation for given format string
func (*Tracer) RegisterInjectionFormat ¶
RegisterInjectionFormat register injector implementation for given format string
func (*Tracer) RootSpan ¶
func (tracer *Tracer) RootSpan() tracing.Span
RootSpan retrieves the root span of the service
func (*Tracer) StartSpan ¶
StartSpan starts a new span based on a parent trace context. The context may come either from external source (extracted from HTTP request, AMQP message, etc., see Extract method) or received from another span in the service.
If parent context does not contain a trace, a new trace will be implicitly created. Use EmptySpanContext to supply empty (nil) context.