tracing

package
v0.0.0-...-11c75a3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEvent

func AddEvent(ctx context.Context, name string, attrs ...attribute.KeyValue)

AddEvent adds an event to the current span

func RecordError

func RecordError(ctx context.Context, err error, opts ...trace.EventOption)

RecordError records an error in the current span

func SetAttributes

func SetAttributes(ctx context.Context, attrs ...attribute.KeyValue)

SetAttributes sets attributes on the current span

func SetStatus

func SetStatus(ctx context.Context, code codes.Code, description string)

SetStatus sets the status of the current span

Types

type TracingService

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

TracingService manages OpenTelemetry tracing

func NewTracingService

func NewTracingService(cfg *config.Config) (*TracingService, error)

NewTracingService creates and configures OpenTelemetry tracing

func (*TracingService) GetProvider

func (s *TracingService) GetProvider() *sdktrace.TracerProvider

GetProvider returns the tracer provider

func (*TracingService) GetTracer

func (s *TracingService) GetTracer() trace.Tracer

GetTracer returns the configured tracer

func (*TracingService) Shutdown

func (s *TracingService) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the tracing provider

func (*TracingService) StartSpan

func (s *TracingService) StartSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

StartSpan starts a new span

Jump to

Keyboard shortcuts

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