zipkin

package
Version: v0.0.0-...-7d43bac Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package zipkin provides support for opentracing zipkin framework.

Index

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

func (s Span) Finish()

Finish stops tracing span.

func (Span) Log

func (s Span) Log(event string)

Log logs tracing span event.

func (Span) LogWithFields

func (s Span) LogWithFields(event string, params map[string]interface{})

LogWithFields logs tracing span with event name and fields.

func (Span) SetTag

func (s Span) SetTag(key string, value interface{})

SetTag sets tag on tracing span.

type Tracer

type Tracer struct {
	Collector zipkin.Collector // zipkin collector
}

Tracer represents tracing mechanism based on opentracing zipkin framework.

func (Tracer) ContextWithSpan

func (t Tracer) ContextWithSpan(ctx context.Context, span trace.Span) context.Context

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

func (t Tracer) InjectSpan(s trace.Span, format interface{}, carrier interface{}) error

InjectSpan injects tracing span in particular format into carrier.

func (Tracer) SpanFromContext

func (t Tracer) SpanFromContext(ctx context.Context) trace.Span

SpanFromContext creates tracing span from context.

func (Tracer) StartSpan

func (t Tracer) StartSpan(name string) trace.Span

StartSpan starts tracing span with name.

func (Tracer) StartSpanFromContext

func (t Tracer) StartSpanFromContext(ctx context.Context, name string) (trace.Span, context.Context)

StartSpanFromContext starts tracing span with name from context.

func (Tracer) StartSpanWithParent

func (t Tracer) StartSpanWithParent(name string, parent trace.Span) trace.Span

StartSpanWithParent starts tracing span with parent span and name.

Jump to

Keyboard shortcuts

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