Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NoopSpan = &span{ tracer: NoopTracing, span: NoopTracing.StartSpan(""), }
NoopSpan does nothing.
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
// NewChildWithStart 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{})
// SetTag sets tag key and value.
SetTag(key string, value string)
// IsNoopSpan returns true if span is NoopSpan.
IsNoopSpan() bool
}
Span is the span of the Tracing.
type Spec ¶
type Spec struct {
ServiceName string `yaml:"serviceName" jsonschema:"required"`
Tags map[string]string `yaml:"tags" jsonschema:"omitempty"`
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 (*Tracing) IsNoopTracer ¶ added in v1.4.1
IsNoopTracer checks whether tracer is noop tracer.
Click to show internal directories.
Click to hide internal directories.