metrics

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics interface {
	Increment(key string, tags map[string]string)
	Counter(key string, tags map[string]string, value int64)
	Distribution(key string, tags map[string]string, value float64)
	DistributionMs(key string, tags map[string]string, value time.Duration)
	WithTags(tags map[string]string) Metrics
}

Metrics is a backend-agnostic interface for emitting metrics. Implementations can route to DataDog, log to slog, or discard (noop).

type NoopMetrics

type NoopMetrics struct{}

NoopMetrics is a no-op implementation of the Metrics interface.

func NewNoopMetrics

func NewNoopMetrics() *NoopMetrics

NewNoopMetrics returns a new NoopMetrics.

func (*NoopMetrics) Counter

func (n *NoopMetrics) Counter(_ string, _ map[string]string, _ int64)

func (*NoopMetrics) Distribution

func (n *NoopMetrics) Distribution(_ string, _ map[string]string, _ float64)

func (*NoopMetrics) DistributionMs

func (n *NoopMetrics) DistributionMs(_ string, _ map[string]string, _ time.Duration)

func (*NoopMetrics) Increment

func (n *NoopMetrics) Increment(_ string, _ map[string]string)

func (*NoopMetrics) WithTags

func (n *NoopMetrics) WithTags(_ map[string]string) Metrics

Jump to

Keyboard shortcuts

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