Documentation
¶
Overview ¶
Package internal hides OTel SDK types behind a thin interface so the public tracer package can stay free of vendor-specific imports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OTelConfig ¶
type OTelConfig struct {
ServiceName string
Endpoint string
Insecure bool
SampleRatio float64
Headers map[string]string
UseGRPC bool
ResourceAttributes []Attribute
}
OTelConfig is the resolved configuration for the OTel impl.
type Span ¶
type Span interface {
End()
SetAttributes(attrs ...Attribute)
SetStatus(code int, description string)
RecordError(err error, attrs ...Attribute)
AddEvent(name string, attrs ...Attribute)
SpanContext() SpanContext
IsRecording() bool
}
Span is the internal span surface.
type SpanContext ¶
SpanContext is the internal mirror of tracer.SpanContext.
type StartConfig ¶
StartConfig is the internal mirror of tracer.StartConfig.
type Tracer ¶
type Tracer interface {
Start(ctx context.Context, name string, cfg StartConfig) (context.Context, Span)
SpanFromContext(ctx context.Context) Span
Inject(ctx context.Context, carrier Carrier)
Extract(ctx context.Context, carrier Carrier) context.Context
Shutdown(ctx context.Context) error
}
Tracer is the internal tracer surface.
func NewNoopTracer ¶
func NewNoopTracer() Tracer
NewNoopTracer returns a Tracer that does nothing — useful when tracing is explicitly disabled.
func NewOTelTracer ¶
func NewOTelTracer(cfg OTelConfig) (Tracer, error)
NewOTelTracer builds an OTel-backed Tracer with an OTLP exporter and the W3C tracecontext + baggage propagator.
Click to show internal directories.
Click to hide internal directories.