Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*config) error
Option provides Tracer configuration options
func WithBatchOptions ¶
func WithBatchOptions(opts []sdktrace.BatchSpanProcessorOption) Option
WithBatchOptions allows overriding the default span batch processing options.
func WithExporter ¶
func WithExporter(exp sdktrace.SpanExporter) Option
WithExporter sets a span exporter other than standard one provided by WithOTLPExporter.
func WithOTLPExporter ¶
WithOTLPExporter configured an OTLP trace exporter
func WithSampler ¶
WithSampler sets the sampler to be used by the underlying tracing provider. If not set, it takes the default of sampling based on whether the parent span was sampled.
func WithSyncExport ¶
func WithSyncExport() Option
WithSyncExport can be used in tests and disables batch span processing.
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer provides a tracing interface that generates traces only if configured with a trace exporter
func New ¶
New creates a Tracer that will create spans if configured with an exporter. If not, the Span method will use a no-op tracing provider. When enabled, the spans will have the supplied service name. The context is used to initialize a configured OTLP exporter, if any.
func (Tracer) SetGlobalTracer ¶ added in v0.13.1
func (t Tracer) SetGlobalTracer()
SetGlobalTracer sets the global tracer provider to this tracer instance