tracing

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoopTracing = &Tracing{
	Tracer: opentracing.NoopTracer{},
	closer: nil,
}

NoopTracing is the tracing doing nothing.

Functions

This section is empty.

Types

type Span

type Span interface {
	// Tracer returns the Tracer that created this Span.
	Tracer() opentracing.Tracer

	// Context yields the SpanContext for this Span
	Context() opentracing.SpanContext

	// Finish finishes the span.
	Finish()
	// Cancel cancels the span, it should be called before Finish called.
	// It will cancel all descendent spans.
	Cancel()

	// NewChild creates a child span.
	NewChild(name string) Span
	// NewChild creates a child span with start time.
	NewChildWithStart(name string, startAt time.Time) Span

	// SetName changes the span name.
	SetName(name string)

	// LogKV logs key:value for the span.
	//
	// The keys must all be strings. The values may be strings, numeric types,
	// bools, Go error instances, or arbitrary structs.
	//
	// Example:
	//
	//    span.LogKV(
	//        "event", "soft error",
	//        "type", "cache timeout",
	//        "waited.millis", 1500)
	LogKV(kvs ...interface{})
}

Span is the span of the Tracing.

func NewSpan

func NewSpan(tracer *Tracing, name string) Span

NewSpan creates a span.

func NewSpanWithStart

func NewSpanWithStart(tracer *Tracing, name string, startAt time.Time) Span

NewSpanWithStart creates a span with specify start time.

type Spec

type Spec struct {
	ServiceName string `yaml:"serviceName" jsonschema:"required"`

	Zipkin *zipkin.Spec `yaml:"zipkin" jsonschema:"omitempty"`
}

Spec describes Tracing.

type Tracing

type Tracing struct {
	opentracing.Tracer
	// contains filtered or unexported fields
}

Tracing is the tracing.

func New

func New(spec *Spec) (*Tracing, error)

New creates a Tracing.

func (*Tracing) Close

func (t *Tracing) Close() error

Close closes Tracing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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