Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Exporter ¶
type Exporter = sdktrace.SpanExporter
type ExporterBuilder ¶
func NewWriterExporter ¶
func NewWriterExporter(w io.Writer) ExporterBuilder
NewWriterExporter returns the writer exporter for spans.
type Option ¶
type Option func(*options)
Option sets the value of an option for a Config.
func WithExporter ¶
func WithExporter(startExporterFn ExporterBuilder) Option
WithExporter sets additional exporter builders for spans. E.g. otlp.Exporter and Thrift
func WithSampler ¶
WithSampler sets sampler, by default there is no sampler.
func WithServiceName ¶
WithServiceName sets service name that will be in attributes of all spans created by this tracer in "service.name" key. Usually it comes in format of service:app.
type Sampler ¶
func TraceIDRatioBasedSampler ¶
TraceIDRatioBasedSampler samples a given fraction of traces. Fractions >= 1 will always sample. Fractions < 0 are treated as zero. To respect the parent trace's `SampledFlag`, the `TraceIDRatioBased` sampler should be used as a delegate of a `Parent` sampler.
type Span ¶
type Span interface { // End completes the Span. The Span is considered complete and ready to be // delivered through the rest of the telemetry pipeline after this method // is called. Therefore, updates to the Span are not allowed after this // method has been called. // TODO(bwplotka): Add Set status to End options. End(err error) // Context returns span context that contains useful information about span and belonging trace. // This information is available even after span End. // NOTE: Do not confuse with Go context.Context which is important, but has to be tracked outside of Span. Context() Context // AddEvent adds an event to the span. This was previously (in OpenTracing) known as // structured logs attached to the span. AddEvent(name string, keyvals ...interface{}) // SetAttributes sets kv as attributes of the Span. If a key from kv // already exists for an attribute of the Span it should be overwritten with // the value contained in kv. SetAttributes(keyvals ...interface{}) }
Span is the individual component of a trace. It represents a single named and timed operation of a workflow that is traced. A Tracer is used to create a Span and it is then up to the operation the Span represents to properly end the Span when the operation itself ends.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is the root tracing entity that can enables creation of spans, and its export to the desired backends in a form of traces.
func NewTracer ¶
func NewTracer(exporter ExporterBuilder, opts ...Option) (*Tracer, func() error, error)
NewTracer creates new instance of Tracer with given exporter builder. Tracer returns tracer and close function that releases all resources or error.
type TracerStartSpanOption ¶
type TracerStartSpanOption func(*tracerStartSpanOptions)
TracerStartSpanOption sets the value in tracerStartSpanOptions.
func WithTracerStartSpanContext ¶
func WithTracerStartSpanContext(ctx context.Context) TracerStartSpanOption