otel

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package otel provides an OpenTelemetry Tracer adapter for Modulex.

It implements the modulex.Tracer interface using an OpenTelemetry TracerProvider, preserving span ancestry and recording errors with the appropriate span status.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTracer

func NewTracer(provider oteltrace.TracerProvider) modulex.Tracer

NewTracer creates a Modulex Tracer backed by OpenTelemetry.

If provider is nil, the global OpenTelemetry TracerProvider is used. The returned tracer is safe for concurrent use.

Types

type Span

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

Span adapts an OpenTelemetry span to modulex.Span.

func (*Span) End

func (s *Span) End()

End implements modulex.Span.

func (*Span) RecordError

func (s *Span) RecordError(err error)

RecordError implements modulex.Span.

func (*Span) SetAttributes

func (s *Span) SetAttributes(attrs map[string]any)

SetAttributes implements modulex.Span.

type Tracer

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

Tracer adapts an OpenTelemetry TracerProvider to modulex.Tracer.

func (*Tracer) ContextWithSpanContext

func (t *Tracer) ContextWithSpanContext(ctx context.Context, sc modulex.SpanContext) context.Context

ContextWithSpanContext implements modulex.Tracer.

func (*Tracer) SpanContextFromContext

func (t *Tracer) SpanContextFromContext(ctx context.Context) modulex.SpanContext

SpanContextFromContext implements modulex.Tracer.

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, spanName string, attrs map[string]any) (context.Context, modulex.Span)

Start implements modulex.Tracer.

Jump to

Keyboard shortcuts

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