metrics

package
v0.0.0-...-b9418e1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMetrics

func NewMetrics(cfg config.Metrics) (*metrics, error)

NewMetrics creates a new Metrics.

func NewNoOp

func NewNoOp() *noopMetrics

Types

type MetricStruct

type MetricStruct any

type Metrics

type Metrics interface {
	// Register registers the provided struct under the provided subsystem name.
	// A MetricStruct is a struct containing members of the various prometheus metric types
	// including Counter, Gauge, Histogram, and Summary.
	// Struct tags:
	// "help" - the metric's help string
	// "buckets" - a list of bucket values for Histogram metrics
	Register(subsys string, ms MetricStruct)

	// Handler returns the metrics endpoint handler.
	Handler() http.Handler

	// InstallRoute installs the metrics endpoint handler in the provided chi router.
	InstallRoute(chi.Router)
}

Metrics is the interface to the metrics subsystem.

Jump to

Keyboard shortcuts

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