Documentation ¶
Index ¶
- func MetricsHandler(_ context.Context) http.Handler
- type BaseMetricsBus
- func (m *BaseMetricsBus[TMetricsBus]) AddCounter(createChild createChildMetric[TMetricsBus], mname, descr string, ...) (*Counter, error)
- func (m *BaseMetricsBus[TMetricsBus]) AddGauge(createChild createChildMetric[TMetricsBus], mname, descr string, ...) (*Gauge, error)
- func (m *BaseMetricsBus[TMetricsBus]) AddHisto(createChild createChildMetric[TMetricsBus], mname, descr string, ...) (*Histo, error)
- func (m *BaseMetricsBus[TMetricsBus]) CreateChild(createChildBus func(b *BaseMetricsBus[TMetricsBus]) *TMetricsBus, ...) *TMetricsBus
- type Counter
- type Gauge
- type Histo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseMetricsBus ¶
type BaseMetricsBus[TMetricsBus any] struct { // contains filtered or unexported fields }
BaseMetricsBus is a base type for metrics buses
func NewBus ¶
func NewBus[TMetricsBus any](ctx context.Context, mPrefix string) *BaseMetricsBus[TMetricsBus]
NewBus creates a new metrics bus
func (*BaseMetricsBus[TMetricsBus]) AddCounter ¶
func (m *BaseMetricsBus[TMetricsBus]) AddCounter( createChild createChildMetric[TMetricsBus], mname, descr string, labels ...basemetrics.LabelName, ) (*Counter, error)
AddCounter adds a new counter to the bus
func (*BaseMetricsBus[TMetricsBus]) AddGauge ¶
func (m *BaseMetricsBus[TMetricsBus]) AddGauge( createChild createChildMetric[TMetricsBus], mname, descr string, labels ...basemetrics.LabelName, ) (*Gauge, error)
AddGauge adds a new gauge to the bus
func (*BaseMetricsBus[TMetricsBus]) AddHisto ¶
func (m *BaseMetricsBus[TMetricsBus]) AddHisto( createChild createChildMetric[TMetricsBus], mname, descr string, buckets []float64, labels ...basemetrics.LabelName, ) (*Histo, error)
AddHisto adds a new histogram to the bus
func (*BaseMetricsBus[TMetricsBus]) CreateChild ¶
func (m *BaseMetricsBus[TMetricsBus]) CreateChild(createChildBus func(b *BaseMetricsBus[TMetricsBus]) *TMetricsBus, parentBus *TMetricsBus, labels ...basemetrics.Label, ) *TMetricsBus
CreateChild creates a child bus
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter is a type for counters
func (*Counter) Add ¶
func (c *Counter) Add(v float64, labels ...basemetrics.Label)
Add adds value to counter
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
Gauge is a type for gauges
func (*Gauge) Add ¶
func (g *Gauge) Add(v float64, labels ...basemetrics.Label)
Add adds value to gauge
Click to show internal directories.
Click to hide internal directories.