metrics

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindSupervisorHooks

func BindSupervisorHooks(s Sink) supervisor.Hooks

func WithContext

func WithContext(ctx context.Context, data ContextData) context.Context

WithContext attaches metric metadata to context.

Types

type ContextData

type ContextData struct {
	Labels map[string]string
}

func FromContext

func FromContext(ctx context.Context) (ContextData, bool)

FromContext extracts metric metadata if present.

type NoopSink

type NoopSink struct{}

=================================================

No-op Sink

=================================================

NoopSink is the default metrics implementation.

Used when: - Metrics disabled - Unit tests - Library consumers that don’t care about metrics

func (NoopSink) SupervisorFailure

func (NoopSink) SupervisorFailure(context.Context, supervisor.FailureKind)

func (NoopSink) SupervisorGiveUp

func (NoopSink) SupervisorGiveUp(context.Context, supervisor.FailureKind)

func (NoopSink) SupervisorRetry

func (NoopSink) SupervisorRetry(context.Context, int)

func (NoopSink) SupervisorStart

func (NoopSink) SupervisorStart(context.Context)

func (NoopSink) SupervisorSuccess

func (NoopSink) SupervisorSuccess(context.Context)

type Sink

type Sink interface {
	SupervisorStart(ctx context.Context)
	SupervisorSuccess(ctx context.Context)
	SupervisorFailure(ctx context.Context, kind supervisor.FailureKind)
	SupervisorRetry(ctx context.Context, attempt int)
	SupervisorGiveUp(ctx context.Context, kind supervisor.FailureKind)
}

func Noop

func Noop() Sink

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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