Versions in this module Expand all Collapse all v0 v0.1.0 Jun 7, 2026 Changes in this version + const DefaultPath + const LabelMethod + const LabelRoute + const LabelStatus + const MetricRequestDuration + const MetricRequestsInFlight + const MetricRequestsTotal + func DefaultRoute(r *http.Request) string + type Backend interface + Counter func(name string) Counter + Gauge func(name string, f func() float64) Gauge + Histogram func(name string, buckets []float64) Histogram + WritePrometheus func(w io.Writer) + type Config struct + Buckets []float64 + Enabled *bool + Namespace string + Path string + type Counter interface + Add func(delta int) + Get func() uint64 + Inc func() + func NopCounter() Counter + type Gauge interface + Add func(delta float64) + Dec func() + Get func() float64 + Inc func() + Set func(v float64) + func NopGauge() Gauge + type Histogram interface + Update func(v float64) + UpdateDuration func(start time.Time) + func NopHistogram() Histogram + type Label struct + Name string + Value string + func L(name, value string) Label + type MiddlewareOption func(*middlewareConfig) + func WithRoute(f RouteFunc) MiddlewareOption + type Option func(*config) + func WithBackend(b Backend) Option + func WithBuckets(bounds ...float64) Option + func WithEnabled(enabled bool) Option + func WithNamespace(ns string) Option + func WithPath(path string) Option + type Registry struct + func FromConfig(cfg Config, opts ...Option) (*Registry, error) + func New(opts ...Option) (*Registry, error) + func (r *Registry) Counter(name string, labels ...Label) Counter + func (r *Registry) Enabled() bool + func (r *Registry) Gauge(name string, labels ...Label) Gauge + func (r *Registry) GaugeFunc(name string, f func() float64, labels ...Label) Gauge + func (r *Registry) Handler() http.Handler + func (r *Registry) Histogram(name string, labels ...Label) Histogram + func (r *Registry) Middleware(opts ...MiddlewareOption) func(http.Handler) http.Handler + func (r *Registry) Namespace() string + func (r *Registry) Path() string + func (r *Registry) Timer(name string, labels ...Label) func() + type RouteFunc func(r *http.Request) string + type Stats struct + Count uint64 + Max float64 + Mean float64 + Min float64 + P map[string]float64 + Sum float64 + type Summary struct + func NewSummary(opts ...SummaryOption) (*Summary, error) + func (s *Summary) Count() uint64 + func (s *Summary) Observe(v float64) + func (s *Summary) ObserveDuration(start time.Time) + func (s *Summary) Quantile(q float64) float64 + func (s *Summary) Stats() Stats + type SummaryOption func(*summaryConfig) + func WithReservoir(n int) SummaryOption + func WithReservoirSeed(seed uint64) SummaryOption + type VictoriaBackend struct + func NewVictoriaBackend(opts ...VictoriaOption) *VictoriaBackend + func (b *VictoriaBackend) Counter(name string) Counter + func (b *VictoriaBackend) Gauge(name string, f func() float64) Gauge + func (b *VictoriaBackend) Histogram(name string, buckets []float64) Histogram + func (b *VictoriaBackend) WritePrometheus(w io.Writer) + type VictoriaOption func(*VictoriaBackend) + func WithoutProcessMetrics() VictoriaOption + func WithoutRuntimeMetrics() VictoriaOption