Documentation ¶
Index ¶
- func MappingFieldSpec() docs.FieldSpec
- type Mapping
- type Namespaced
- func (n *Namespaced) Close() error
- func (n *Namespaced) GetCounter(path string) metrics.StatCounter
- func (n *Namespaced) GetCounterVec(path string, labelNames []string) metrics.StatCounterVec
- func (n *Namespaced) GetGauge(path string) metrics.StatGauge
- func (n *Namespaced) GetGaugeVec(path string, labelNames []string) metrics.StatGaugeVec
- func (n *Namespaced) GetTimer(path string) metrics.StatTimer
- func (n *Namespaced) GetTimerVec(path string, labelNames []string) metrics.StatTimerVec
- func (n *Namespaced) SetLogger(log log.Modular)
- func (n *Namespaced) Unwrap() metrics.Type
- func (n *Namespaced) WithLabels(labels ...string) *Namespaced
- func (n *Namespaced) WithMapping(m *Mapping) *Namespaced
- func (n *Namespaced) WithPrefix(str string) *Namespaced
- func (n *Namespaced) WithStats(s metrics.Type) *Namespaced
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MappingFieldSpec ¶
MappingFieldSpec is a field spec that describes a Bloblang mapping for renaming metrics.
Types ¶
type Mapping ¶
type Mapping struct {
// contains filtered or unexported fields
}
Mapping is a compiled Bloblang mapping used to rewrite metrics.
type Namespaced ¶
type Namespaced struct {
// contains filtered or unexported fields
}
Namespaced wraps a child metrics exporter and exposes a metrics.Type API that adds namespacing labels and name prefixes to new metrics.
func NewNamespaced ¶
func NewNamespaced(child metrics.Type) *Namespaced
NewNamespaced wraps a metrics exporter and adds prefixes and custom labels.
func (*Namespaced) Close ¶
func (n *Namespaced) Close() error
Close stops aggregating stats and cleans up resources.
func (*Namespaced) GetCounter ¶
func (n *Namespaced) GetCounter(path string) metrics.StatCounter
GetCounter returns an editable counter stat for a given path.
func (*Namespaced) GetCounterVec ¶
func (n *Namespaced) GetCounterVec(path string, labelNames []string) metrics.StatCounterVec
GetCounterVec returns an editable counter stat for a given path with labels, these labels must be consistent with any other metrics registered on the same path.
func (*Namespaced) GetGauge ¶
func (n *Namespaced) GetGauge(path string) metrics.StatGauge
GetGauge returns an editable gauge stat for a given path.
func (*Namespaced) GetGaugeVec ¶
func (n *Namespaced) GetGaugeVec(path string, labelNames []string) metrics.StatGaugeVec
GetGaugeVec returns an editable gauge stat for a given path with labels, these labels must be consistent with any other metrics registered on the same path.
func (*Namespaced) GetTimer ¶
func (n *Namespaced) GetTimer(path string) metrics.StatTimer
GetTimer returns an editable timer stat for a given path.
func (*Namespaced) GetTimerVec ¶
func (n *Namespaced) GetTimerVec(path string, labelNames []string) metrics.StatTimerVec
GetTimerVec returns an editable timer stat for a given path with labels, these labels must be consistent with any other metrics registered on the same path.
func (*Namespaced) SetLogger ¶
func (n *Namespaced) SetLogger(log log.Modular)
SetLogger sets the logging mechanism of the metrics type.
func (*Namespaced) Unwrap ¶
func (n *Namespaced) Unwrap() metrics.Type
Unwrap to the underlying metrics type.
func (*Namespaced) WithLabels ¶
func (n *Namespaced) WithLabels(labels ...string) *Namespaced
WithLabels returns a namespaced metrics exporter with a new set of labels, which are added to any prior labels.
func (*Namespaced) WithMapping ¶
func (n *Namespaced) WithMapping(m *Mapping) *Namespaced
WithMapping returns a namespaced metrics exporter with a new mapping. Mappings are applied _before_ the prefix and static labels are applied. Mappings already added are executed after this new mapping.
func (*Namespaced) WithPrefix ¶
func (n *Namespaced) WithPrefix(str string) *Namespaced
WithPrefix returns a namespaced metrics exporter with a new prefix.
func (*Namespaced) WithStats ¶
func (n *Namespaced) WithStats(s metrics.Type) *Namespaced
WithStats returns a namespaced metrics exporter with a different stats implementation.