noop

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

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 NewSpan

func NewSpan(isRoot bool) *Span

NewSpan returns a new Span

func (*Span) Annotate

func (span *Span) Annotate(message string)

Annotate associates an event that explains latency with a timestamp.

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) IsRoot

func (span *Span) IsRoot() bool

IsRoot tells whether the span is a root span

func (*Span) Log

func (span *Span) Log(fields map[string]string)

Log stores structured data. Despite this functionality being outlined in OpenTracing spec it's currently only supported in Jaeger

func (*Span) SetName

func (span *Span) SetName(name string)

SetName sets (overrides) the string name for the logical operation this span represents.

func (*Span) Tag

func (span *Span) Tag(key string, value string)

Tag give your span context for search, viewing and analysis. For example, a key "your_app.version" would let you lookup spans by version.

type SpanContext

type SpanContext struct {
}

SpanContext holds the context of a Span. It should be initialized using NewSpanContext method.

func NewSpanContext

func NewSpanContext() *SpanContext

NewSpanContext returns a new SpanContext

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 NewTracer

func NewTracer() *Tracer

NewTracer returns a new Zipkin tracer.

func (*Tracer) Close

func (tracer *Tracer) Close() error

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

func (tracer *Tracer) Extract(carrier interface{}, format string) (tracing.SpanContext, error)

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

func (tracer *Tracer) Inject(carrier interface{}, format string) error

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

func (tracer *Tracer) RegisterExtractionFormat(format string, extractor tracing.Extractor)

RegisterExtractionFormat register extractor implementation for given format string

func (*Tracer) RegisterInjectionFormat

func (tracer *Tracer) RegisterInjectionFormat(format string, injector tracing.Injector)

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

func (tracer *Tracer) StartSpan(name string, spanCtx tracing.SpanContext) tracing.Span

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.

func (*Tracer) UUID

func (tracer *Tracer) UUID() string

UUID retrieves unique identifier associated with a root span

Jump to

Keyboard shortcuts

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