otel

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseSpan

func CloseSpan(span trace.Span, err error)

CloseSpan closes a span and records the given error if not nil. If the span is nil, this is a noop.

func StartSpan

func StartSpan(ctx context.Context, tracer trace.Tracer, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

StartSpan will start a span using the tracer on input. If the tracer is nil, the context returned is the same as on input, and the span will be nil.

Types

type Config added in v0.6.0

type Config struct {
	Metrics *MetricsConfig
	Traces  *TracesConfig
}

type Instrumentation

type Instrumentation struct {
	Meter  metric.Meter
	Tracer trace.Tracer
}

func (*Instrumentation) IsEnabled

func (i *Instrumentation) IsEnabled() bool

type InstrumentationProvider added in v0.6.0

type InstrumentationProvider interface {
	NewInstrumentation(name string) *Instrumentation
	Close() error
}

func NewInstrumentationProvider added in v0.6.0

func NewInstrumentationProvider(cfg *Config) (InstrumentationProvider, error)

type MetricsConfig added in v0.6.0

type MetricsConfig struct {
	Endpoint           string
	CollectionInterval time.Duration
}

type Provider added in v0.6.0

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

func NewProvider added in v0.6.0

func NewProvider(cfg *Config) (*Provider, error)

func (*Provider) Close added in v0.6.0

func (o *Provider) Close() error

func (*Provider) Meter added in v0.6.0

func (o *Provider) Meter(name string) metric.Meter

func (*Provider) NewInstrumentation added in v0.6.0

func (o *Provider) NewInstrumentation(name string) *Instrumentation

func (*Provider) Tracer added in v0.6.0

func (o *Provider) Tracer(name string) trace.Tracer

type TracesConfig added in v0.6.0

type TracesConfig struct {
	Endpoint    string
	SampleRatio float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL