package observ

import "go.opentelemetry.io/otel/sdk/trace/internal/observ"

Package observ provides observability instrumentation for the OTel trace SDK package.

Index

Constants

const (
	// ScopeName is the name of the instrumentation scope.
	ScopeName = "go.opentelemetry.io/otel/sdk/trace/internal/observ"

	// SchemaURL is the schema URL of the instrumentation.
	SchemaURL = semconv.SchemaURL
)

Variables

var ErrQueueFull = otelconv.SDKProcessorSpanProcessed{}.AttrErrorType(
	otelconv.ErrorTypeAttr("queue_full"),
)

ErrQueueFull is the attribute value for the "queue_full" error type.

Functions

func BSPComponentName

func BSPComponentName(id int64) attribute.KeyValue

BSPComponentName returns the component name attribute for a BatchSpanProcessor with the given ID.

func SSPComponentName

func SSPComponentName(id int64) attribute.KeyValue

SSPComponentName returns the component name attribute for a SimpleSpanProcessor with the given ID.

Types

type BSP

type BSP struct {
	// contains filtered or unexported fields
}

BSP is the instrumentation for an OTel SDK BatchSpanProcessor.

func NewBSP

func NewBSP(id int64, qLen func() int64, qMax int64) (*BSP, error)

func (*BSP) Processed

func (b *BSP) Processed(ctx context.Context, n int64)

func (*BSP) ProcessedQueueFull

func (b *BSP) ProcessedQueueFull(ctx context.Context, n int64)

func (*BSP) Shutdown

func (b *BSP) Shutdown() error

type SSP

type SSP struct {
	// contains filtered or unexported fields
}

SSP is the instrumentation for an OTel SDK SimpleSpanProcessor.

func NewSSP

func NewSSP(id int64) (*SSP, error)

NewSSP returns instrumentation for an OTel SDK SimpleSpanProcessor with the provided ID.

If the experimental observability is disabled, nil is returned.

func (*SSP) SpanProcessed

func (ssp *SSP) SpanProcessed(ctx context.Context, err error)

SpanProcessed records that a span has been processed by the SimpleSpanProcessor. If err is non-nil, it records the processing error as an attribute.

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

Tracer is instrumentation for an OTel SDK Tracer.

func NewTracer

func NewTracer() (Tracer, error)

func (Tracer) Enabled

func (t Tracer) Enabled() bool

func (Tracer) SpanEnded

func (t Tracer) SpanEnded(ctx context.Context, span trace.Span)

func (Tracer) SpanLive

func (t Tracer) SpanLive(ctx context.Context, span trace.Span)

func (Tracer) SpanStarted

func (t Tracer) SpanStarted(ctx context.Context, psc trace.SpanContext, span trace.Span)

Source Files

batch_span_processor.go doc.go simple_span_processor.go tracer.go

Version
v1.41.0
Published
Mar 2, 2026
Platform
linux/amd64
Imports
12 packages
Last checked
3 hours ago

Tools for package owners.