Versions in this module Expand all Collapse all v1 v1.1.7 Apr 1, 2021 Changes in this version + const DefaultSignal + func AddSample(key []string, val float32) + func AddSampleWithLabels(key []string, val float32, labels []Label) + func EmitKey(key []string, val float32) + func IncrCounter(key []string, val float32) + func IncrCounterWithLabels(key []string, val float32, labels []Label) + func MeasureSince(key []string, start time.Time) + func MeasureSinceWithLabels(key []string, start time.Time, labels []Label) + func SetGauge(key []string, val float32) + func SetGaugeWithLabels(key []string, val float32, labels []Label) + func UpdateFilter(allow, block []string) + func UpdateFilterAndLabels(allow, block, allowedLabels, blockedLabels []string) + type AggregateSample struct + Count int + LastUpdated time.Time + Max float64 + Min float64 + Rate float64 + Sum float64 + SumSq float64 + func (a *AggregateSample) Ingest(v float64, rateDenom float64) + func (a *AggregateSample) Mean() float64 + func (a *AggregateSample) Stddev() float64 + func (a *AggregateSample) String() string + type BlackholeSink struct + func (*BlackholeSink) AddSample(key []string, val float32) + func (*BlackholeSink) AddSampleWithLabels(key []string, val float32, labels []Label) + func (*BlackholeSink) EmitKey(key []string, val float32) + func (*BlackholeSink) IncrCounter(key []string, val float32) + func (*BlackholeSink) IncrCounterWithLabels(key []string, val float32, labels []Label) + func (*BlackholeSink) SetGauge(key []string, val float32) + func (*BlackholeSink) SetGaugeWithLabels(key []string, val float32, labels []Label) + type Config struct + AllowedLabels []string + AllowedPrefixes []string + BlockedLabels []string + BlockedPrefixes []string + EnableHostname bool + EnableHostnameLabel bool + EnableRuntimeMetrics bool + EnableServiceLabel bool + EnableTypePrefix bool + FilterDefault bool + HostName string + ProfileInterval time.Duration + ServiceName string + TimerGranularity time.Duration + func DefaultConfig(serviceName string) *Config + type FanoutSink []MetricSink + func (fh FanoutSink) AddSample(key []string, val float32) + func (fh FanoutSink) AddSampleWithLabels(key []string, val float32, labels []Label) + func (fh FanoutSink) EmitKey(key []string, val float32) + func (fh FanoutSink) IncrCounter(key []string, val float32) + func (fh FanoutSink) IncrCounterWithLabels(key []string, val float32, labels []Label) + func (fh FanoutSink) SetGauge(key []string, val float32) + func (fh FanoutSink) SetGaugeWithLabels(key []string, val float32, labels []Label) + type GaugeValue struct + DisplayLabels map[string]string + Hash string + Labels []Label + Name string + Value float32 + type InmemSignal struct + func DefaultInmemSignal(inmem *InmemSink) *InmemSignal + func NewInmemSignal(inmem *InmemSink, sig syscall.Signal, w io.Writer) *InmemSignal + func (i *InmemSignal) Stop() + type InmemSink struct + func NewInmemSink(interval, retain time.Duration) *InmemSink + func (i *InmemSink) AddSample(key []string, val float32) + func (i *InmemSink) AddSampleWithLabels(key []string, val float32, labels []Label) + func (i *InmemSink) Data() []*IntervalMetrics + func (i *InmemSink) DisplayMetrics(resp http.ResponseWriter, req *http.Request) (interface{}, error) + func (i *InmemSink) EmitKey(key []string, val float32) + func (i *InmemSink) IncrCounter(key []string, val float32) + func (i *InmemSink) IncrCounterWithLabels(key []string, val float32, labels []Label) + func (i *InmemSink) SetGauge(key []string, val float32) + func (i *InmemSink) SetGaugeWithLabels(key []string, val float32, labels []Label) + type IntervalMetrics struct + Counters map[string]SampledValue + Gauges map[string]GaugeValue + Interval time.Time + Points map[string][]float32 + Samples map[string]SampledValue + func NewIntervalMetrics(intv time.Time) *IntervalMetrics + type Label struct + Name string + Value string + type MetricSink interface + AddSample func(key []string, val float32) + AddSampleWithLabels func(key []string, val float32, labels []Label) + EmitKey func(key []string, val float32) + IncrCounter func(key []string, val float32) + IncrCounterWithLabels func(key []string, val float32, labels []Label) + SetGauge func(key []string, val float32) + SetGaugeWithLabels func(key []string, val float32, labels []Label) + func NewInmemSinkFromURL(u *url.URL) (MetricSink, error) + func NewMetricSinkFromURL(urlStr string) (MetricSink, error) + func NewStatsdSinkFromURL(u *url.URL) (MetricSink, error) + func NewStatsiteSinkFromURL(u *url.URL) (MetricSink, error) + type Metrics struct + func Default() *Metrics + func New(conf *Config, sink MetricSink) (*Metrics, error) + func NewGlobal(conf *Config, sink MetricSink) (*Metrics, error) + func (m *Metrics) AddSample(key []string, val float32) + func (m *Metrics) AddSampleWithLabels(key []string, val float32, labels []Label) + func (m *Metrics) EmitKey(key []string, val float32) + func (m *Metrics) EmitRuntimeStats() + func (m *Metrics) IncrCounter(key []string, val float32) + func (m *Metrics) IncrCounterWithLabels(key []string, val float32, labels []Label) + func (m *Metrics) MeasureSince(key []string, start time.Time) + func (m *Metrics) MeasureSinceWithLabels(key []string, start time.Time, labels []Label) + func (m *Metrics) SetGauge(key []string, val float32) + func (m *Metrics) SetGaugeWithLabels(key []string, val float32, labels []Label) + func (m *Metrics) UpdateFilter(allow, block []string) + func (m *Metrics) UpdateFilterAndLabels(allow, block, allowedLabels, blockedLabels []string) + type MetricsSummary struct + Counters []SampledValue + Gauges []GaugeValue + Points []PointValue + Samples []SampledValue + Timestamp string + type PointValue struct + Name string + Points []float32 + type SampledValue struct + DisplayLabels map[string]string + Hash string + Labels []Label + Mean float64 + Name string + Stddev float64 + type StatsdSink struct + func NewStatsdSink(addr string) (*StatsdSink, error) + func (s *StatsdSink) AddSample(key []string, val float32) + func (s *StatsdSink) AddSampleWithLabels(key []string, val float32, labels []Label) + func (s *StatsdSink) EmitKey(key []string, val float32) + func (s *StatsdSink) IncrCounter(key []string, val float32) + func (s *StatsdSink) IncrCounterWithLabels(key []string, val float32, labels []Label) + func (s *StatsdSink) SetGauge(key []string, val float32) + func (s *StatsdSink) SetGaugeWithLabels(key []string, val float32, labels []Label) + func (s *StatsdSink) Shutdown() + type StatsiteSink struct + func NewStatsiteSink(addr string) (*StatsiteSink, error) + func (s *StatsiteSink) AddSample(key []string, val float32) + func (s *StatsiteSink) AddSampleWithLabels(key []string, val float32, labels []Label) + func (s *StatsiteSink) EmitKey(key []string, val float32) + func (s *StatsiteSink) IncrCounter(key []string, val float32) + func (s *StatsiteSink) IncrCounterWithLabels(key []string, val float32, labels []Label) + func (s *StatsiteSink) SetGauge(key []string, val float32) + func (s *StatsiteSink) SetGaugeWithLabels(key []string, val float32, labels []Label) + func (s *StatsiteSink) Shutdown()