Documentation ¶
Index ¶
- Constants
- func Flatten(name string, labels []string, separator string) string
- func Labels(labels, values []string, stringsprefix, fieldsep, recsep string) string
- func TargetName(service, host, path, target string) (string, error)
- func TargetNameWith(name string, values []string) (string, error)
- type CirconusProvider
- type DiscardProvider
- type DogstatsdProvider
- type GraphiteProvider
- type MultiCounter
- type MultiGauge
- type MultiHistogram
- type MultiProvider
- type PromProvider
- type Provider
- type Service
- type StatsdProvider
Constants ¶
const DefaultNames = "{{clean .Service}}.{{clean .Host}}.{{clean .Path}}.{{clean .TargetURL.Host}}"
DefaultNames contains the default template for route metric names for backends that don't support tags.
const DefaultPrefix = "{{clean .Hostname}}.{{clean .Exec}}"
DefaulPrefix contains the default template for metrics prefix.
const DotSeparator = "."
const PipeSeparator = "|"
const RoutePrefix = "route"
Variables ¶
This section is empty.
Functions ¶
func TargetName ¶
TargetName returns the metrics name from the given parameters.
Types ¶
type CirconusProvider ¶ added in v1.6.0
type CirconusProvider struct {
// contains filtered or unexported fields
}
func NewCirconusProvider ¶ added in v1.6.0
func (*CirconusProvider) NewCounter ¶ added in v1.6.0
func (cp *CirconusProvider) NewCounter(name string, labels ...string) gkm.Counter
func (*CirconusProvider) NewGauge ¶ added in v1.6.0
func (cp *CirconusProvider) NewGauge(name string, labels ...string) gkm.Gauge
func (*CirconusProvider) NewHistogram ¶ added in v1.6.0
func (cp *CirconusProvider) NewHistogram(name string, labels ...string) gkm.Histogram
type DiscardProvider ¶ added in v1.6.0
type DiscardProvider struct{}
func (DiscardProvider) NewCounter ¶ added in v1.6.0
func (dp DiscardProvider) NewCounter(name string, labels ...string) gkm.Counter
func (DiscardProvider) NewGauge ¶ added in v1.6.0
func (dp DiscardProvider) NewGauge(name string, labels ...string) gkm.Gauge
func (DiscardProvider) NewHistogram ¶ added in v1.6.0
func (dp DiscardProvider) NewHistogram(name string, labels ...string) gkm.Histogram
type DogstatsdProvider ¶ added in v1.6.0
func NewDogstatsdProvider ¶ added in v1.6.0
func NewDogstatsdProvider(prefix, addr string, interval time.Duration) (*DogstatsdProvider, error)
func (*DogstatsdProvider) NewCounter ¶ added in v1.6.0
func (dp *DogstatsdProvider) NewCounter(name string, labels ...string) gkm.Counter
func (*DogstatsdProvider) NewGauge ¶ added in v1.6.0
func (dp *DogstatsdProvider) NewGauge(name string, labels ...string) gkm.Gauge
func (*DogstatsdProvider) NewHistogram ¶ added in v1.6.0
func (dp *DogstatsdProvider) NewHistogram(name string, labels ...string) gkm.Histogram
type GraphiteProvider ¶ added in v1.6.0
func NewGraphiteProvider ¶ added in v1.6.0
func (*GraphiteProvider) NewCounter ¶ added in v1.6.0
func (g *GraphiteProvider) NewCounter(name string, labels ...string) gkm.Counter
func (*GraphiteProvider) NewGauge ¶ added in v1.6.0
func (g *GraphiteProvider) NewGauge(name string, labels ...string) gkm.Gauge
func (*GraphiteProvider) NewHistogram ¶ added in v1.6.0
func (g *GraphiteProvider) NewHistogram(name string, labels ...string) gkm.Histogram
type MultiCounter ¶ added in v1.6.0
type MultiCounter struct {
// contains filtered or unexported fields
}
MultiCounter wraps zero or more counters.
func (*MultiCounter) Add ¶ added in v1.6.0
func (mc *MultiCounter) Add(v float64)
type MultiGauge ¶ added in v1.6.0
type MultiGauge struct {
// contains filtered or unexported fields
}
MultiGauge wraps zero or more gauges.
func (*MultiGauge) Add ¶ added in v1.6.0
func (m *MultiGauge) Add(val float64)
func (*MultiGauge) Set ¶ added in v1.6.0
func (m *MultiGauge) Set(n float64)
type MultiHistogram ¶ added in v1.6.0
type MultiHistogram struct {
// contains filtered or unexported fields
}
func (*MultiHistogram) Observe ¶ added in v1.6.0
func (m *MultiHistogram) Observe(value float64)
type MultiProvider ¶ added in v1.6.0
type MultiProvider struct {
// contains filtered or unexported fields
}
MultiProvider wraps zero or more providers.
func NewMultiProvider ¶ added in v1.6.0
func NewMultiProvider(p []Provider) *MultiProvider
func (*MultiProvider) NewCounter ¶ added in v1.6.0
func (mp *MultiProvider) NewCounter(name string, labels ...string) gkm.Counter
NewCounter creates a MultiCounter with counter objects for all registered providers.
func (*MultiProvider) NewGauge ¶ added in v1.6.0
func (mp *MultiProvider) NewGauge(name string, labels ...string) gkm.Gauge
NewGauge creates a MultiGauge with gauge objects for all registered providers.
func (*MultiProvider) NewHistogram ¶ added in v1.6.0
func (mp *MultiProvider) NewHistogram(name string, labels ...string) gkm.Histogram
type PromProvider ¶ added in v1.6.0
type PromProvider struct { Opts promclient.Opts Buckets []float64 }
func (*PromProvider) NewCounter ¶ added in v1.6.0
func (p *PromProvider) NewCounter(name string, labels ...string) gkm.Counter
func (*PromProvider) NewGauge ¶ added in v1.6.0
func (p *PromProvider) NewGauge(name string, labels ...string) gkm.Gauge
func (*PromProvider) NewHistogram ¶ added in v1.6.0
func (p *PromProvider) NewHistogram(name string, labels ...string) gkm.Histogram
type Provider ¶ added in v1.6.0
type Provider interface { // NewCounter creates a new counter object. NewCounter(name string, labels ...string) gkm.Counter // NewGauge creates a new gauge object. NewGauge(name string, labels ...string) gkm.Gauge // NewHistogram creates a new histogram object NewHistogram(name string, labels ...string) gkm.Histogram }
Provider is an abstraction of a metrics backend.
func NewPromProvider ¶ added in v1.6.0
type StatsdProvider ¶ added in v1.6.0
func NewStatsdProvider ¶ added in v1.6.0
func NewStatsdProvider(prefix, addr string, interval time.Duration) (*StatsdProvider, error)
func (*StatsdProvider) NewCounter ¶ added in v1.6.0
func (p *StatsdProvider) NewCounter(name string, labels ...string) gkm.Counter
NewCounter - This assumes if there are labels, there will be a With() call
func (*StatsdProvider) NewGauge ¶ added in v1.6.0
func (p *StatsdProvider) NewGauge(name string, labels ...string) gkm.Gauge
NewGauge - this assumes if there are labels, there will be a With() call.
func (*StatsdProvider) NewHistogram ¶ added in v1.6.0
func (p *StatsdProvider) NewHistogram(name string, labels ...string) gkm.Histogram
NewHistogram - this assumes if there are labels, there will be a With() call.