Documentation
¶
Overview ¶
Package metrics defines a Prometheus-style metrics abstraction for exposing gauges, counters, and observers (histograms/summaries).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter interface {
Inc()
Add(float64)
}
Counter is a metric that represents a monotonically increasing value.
type Metrics ¶
type Metrics interface {
// Counter returns a Counter with the given name and labels.
Counter(name MetricName, labels Labels) Counter
// Gauge returns a Gauge with the given name and labels.
Gauge(name MetricName, labels Labels) Gauge
// Observer returns an Observer with the given name and labels.
Observer(name MetricName, labels Labels) Observer
}
Metrics is the top-level metrics factory. It creates or retrieves metric instances by name and labels, following the Prometheus pattern where label sets produce unique metric instances.