observability

package
v0.0.0-...-2bd5d0f Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DurationOperation

type DurationOperation struct {
	Namespace  string
	Name       string
	Duration   time.Duration
	StatusCode int
	Err        error
	Attributes []attribute.KeyValue
}

DurationOperation describes one low-cardinality duration measurement.

type Exporter

type Exporter string

Exporter identifies the telemetry exporter backend.

const (
	ExporterNone Exporter = "none"
	ExporterOTLP Exporter = "otlp"
)

type Operation

type Operation struct {
	Namespace string
	Name      string
	Err       error
}

Operation describes one low-cardinality operation measurement.

type Scope

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

Scope groups telemetry instruments and logging for a package or subsystem.

func NewScope

func NewScope(logger *slog.Logger, name string) *Scope

NewScope creates an observability scope.

func (*Scope) RecordDuration

func (s *Scope) RecordDuration(ctx context.Context, op DurationOperation)

RecordDuration records request or batch latency with low-cardinality attributes.

func (*Scope) RecordOperation

func (s *Scope) RecordOperation(ctx context.Context, op Operation)

RecordOperation records a span result, metrics, and a trace-aware log entry.

func (*Scope) Start

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

Start starts a span in the scope.

type SetupResult

type SetupResult struct {
	Shutdown Shutdown
	Logger   *slog.Logger
	LogLevel *slog.LevelVar
}

SetupResult contains initialized observability runtime dependencies.

func Setup

Setup initializes logging and telemetry providers.

type Shutdown

type Shutdown func(context.Context) error

Shutdown releases observability resources.

Jump to

Keyboard shortcuts

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