tracing

package
v0.0.0-...-5106b98 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorAttributes

func ErrorAttributes(err error) []attribute.KeyValue

ErrorAttributes returns safe error classification attributes for spans.

func HTTPMiddleware

func HTTPMiddleware(component string) fiber.Handler

HTTPMiddleware starts or continues a server span for a Fiber request.

func NewPGXTracer

func NewPGXTracer() pgx.QueryTracer

NewPGXTracer returns a pgx tracer that records database dependency spans.

func NewTracerProvider

func NewTracerProvider(
	ctx context.Context,
	cfg Config,
	options ...providerOption,
) (*sdktrace.TracerProvider, io.Closer, error)

NewTracerProvider creates an OpenTelemetry tracer provider.

func RecordError

func RecordError(span trace.Span, err error)

RecordError records a sanitized error classification on span.

func Setup

func Setup(ctx context.Context, cfg Config, options ...providerOption) (io.Closer, error)

Setup configures tracing and optionally installs the provider and propagator globally.

func StartMethodSpan

func StartMethodSpan(ctx context.Context, method MethodSpan) (context.Context, trace.Span)

StartMethodSpan starts an internal span for a decorated method boundary.

func WithSpanProcessor

func WithSpanProcessor(processor sdktrace.SpanProcessor) providerOption

WithSpanProcessor adds a span processor to the tracer provider.

Types

type Config

type Config struct {
	Component              string
	Environment            string
	OTLPTracesEndpoint     string
	SamplingRatio          float64
	InstallGlobalProviders bool
}

Config contains tracing runtime configuration.

type MethodSpan

type MethodSpan struct {
	Layer     string
	Package   string
	Interface string
	Method    string
}

MethodSpan describes one service or repository method span.

Jump to

Keyboard shortcuts

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