Documentation ¶
Overview ¶
Package zipkin provides support for opentracing zipkin framework.
Index ¶
- func NewTracer(address string, serviceName string, serviceAddress *url.URL, opts ...cb.Option) trace.Tracer
- type Span
- type Tracer
- func (t Tracer) ContextWithSpan(ctx context.Context, span trace.Span) context.Context
- func (t *Tracer) Dispose()
- func (t Tracer) ExtractSpan(name string, format interface{}, carrier interface{}) (trace.Span, error)
- func (t Tracer) InjectSpan(s trace.Span, format interface{}, carrier interface{}) error
- func (t Tracer) SpanFromContext(ctx context.Context) trace.Span
- func (t Tracer) StartSpan(name string) trace.Span
- func (t Tracer) StartSpanFromContext(ctx context.Context, name string) (trace.Span, context.Context)
- func (t Tracer) StartSpanWithParent(name string, parent trace.Span) trace.Span
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTracer ¶
func NewTracer(address string, serviceName string, serviceAddress *url.URL, opts ...cb.Option) trace.Tracer
NewTracer creates an instance of tracer based on opentracing zipkin framework. Additional options passed as arguments are used to configure circuit breaker pattern to connect to zipkin instance. Panics if cannot connect to collector or cannot create zipkin instance.
Types ¶
type Span ¶
type Span struct {
RawSpan opentracing.Span // opentracing span
}
Span represents tracing span based on opentracing zipkin framework.
func (Span) LogWithFields ¶
LogWithFields logs tracing span with event name and fields.
type Tracer ¶
Tracer represents tracing mechanism based on opentracing zipkin framework.
func (Tracer) ContextWithSpan ¶
ContextWithSpan creates context with tracing span.
func (*Tracer) Dispose ¶
func (t *Tracer) Dispose()
Dispose closes zipkin collector and cleans up tracer instance.
func (Tracer) ExtractSpan ¶
func (t Tracer) ExtractSpan(name string, format interface{}, carrier interface{}) (trace.Span, error)
ExtractSpan extracts tracing span in particular format from carrier and starts new tracing span with name and extracted span as a parent.
func (Tracer) InjectSpan ¶
InjectSpan injects tracing span in particular format into carrier.
func (Tracer) SpanFromContext ¶
SpanFromContext creates tracing span from context.