observability

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	// RecordDuration records the duration of an operation.
	RecordDuration(operation string, duration time.Duration, labels map[string]string)

	// RecordCount records the count of an operation (success/failure).
	RecordCount(operation string, status string, labels map[string]string)

	// RecordValue records a custom metric value.
	RecordValue(metricName string, value float64, labels map[string]string)
}

Collector defines the interface for collecting metrics.

func NewNoopCollector

func NewNoopCollector() Collector

NewNoopCollector creates a no-op collector that discards all metrics.

type Span

type Span interface {
	// SetTag sets a tag on the span.
	SetTag(key string, value interface{})

	// LogEvent logs an event within the span.
	LogEvent(eventName string, fields map[string]interface{})

	// End ends the span.
	End()
}

Span represents a single operation in a trace.

type Tracer

type Tracer interface {
	// StartSpan starts a new span/tracing context.
	StartSpan(ctx context.Context, operationName string) (context.Context, Span)

	// GetSpan retrieves the current span from context.
	GetSpan(ctx context.Context) Span
}

Tracer defines the interface for distributed tracing.

func NewNoopTracer

func NewNoopTracer() Tracer

NewNoopTracer creates a no-op tracer.

Jump to

Keyboard shortcuts

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