telemetry

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewOTelTracer

func NewOTelTracer(tracer trace.Tracer) core.Tracer

NewOTelTracer creates a new OTelTracer from an OpenTelemetry trace.Tracer.

func TagsToAttrs

func TagsToAttrs(tags map[string]string) []attribute.KeyValue

Types

type MeterProvider

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

func NewMeterProvider

func NewMeterProvider() *MeterProvider

func (*MeterProvider) Enabled

func (mp *MeterProvider) Enabled() bool

func (*MeterProvider) Meter

func (mp *MeterProvider) Meter(name string) metric.Meter

Meter returns the registered metric.Meter, or nil if none is configured. Callers must check Enabled() before calling Meter() to avoid nil panics.

func (*MeterProvider) RegisterMeter

func (mp *MeterProvider) RegisterMeter(name string, m metric.Meter)

func (*MeterProvider) SetMeter

func (mp *MeterProvider) SetMeter(m metric.Meter)

type OTelSpan

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

OTelSpan wraps the OpenTelemetry trace.Span to implement core.Span.

func (*OTelSpan) End

func (o *OTelSpan) End()

End completes the span.

func (*OTelSpan) Error

func (o *OTelSpan) Error(err error)

Error records an error in the span and marks it as failed.

func (*OTelSpan) RecordError

func (o *OTelSpan) RecordError(err error)

RecordError records an error in the span. This implements the core.Span interface.

func (*OTelSpan) SetAttr

func (o *OTelSpan) SetAttr(key string, value interface{})

SetAttr sets a key-value attribute on the span. It converts interface{} values to appropriate OTel attribute types.

func (*OTelSpan) SetAttributes

func (o *OTelSpan) SetAttributes(attributes map[string]any)

SetAttributes sets multiple attributes.

func (*OTelSpan) SetStatus

func (o *OTelSpan) SetStatus(code string, msg string)

SetStatus sets the status of the span.

type OTelTracer

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

OTelTracer wraps the OpenTelemetry trace.Tracer to implement core.Tracer. This adapter encapsulates all OTel-specific logic, allowing the rest of the codebase to depend only on the high-level core.Tracer interface.

func (*OTelTracer) Start

func (o *OTelTracer) Start(ctx context.Context, name string) (context.Context, core.Span)

Start creates a new OTel span wrapped in the core.Span interface.

Jump to

Keyboard shortcuts

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