metrics

package
v3.57.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MappingFieldSpec

func MappingFieldSpec() docs.FieldSpec

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.

func NewMapping

func NewMapping(mgr types.Manager, mapping string, logger log.Modular) (*Mapping, error)

NewMapping parses a Bloblang mapping and returns a metrics mapping.

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.

Jump to

Keyboard shortcuts

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