metrics: go.uber.org/net/metrics/push Index | Files

package push

import "go.uber.org/net/metrics/push"

Package push integrates go.uber.org/net/metrics with push-based telemetry systems like Graphite and M3. To integrate with such a system, implement the Target interface and use the Push method on metrics.Root.

See the go.uber.org/net/metrics/tallypush package for an example integration with both StatsD- and M3-based systems.

Index

Package Files

nop.go push.go

type Counter Uses

type Counter interface {
    Set(total int64)
}

A Counter models monotonically increasing values, like a car's odometer. Implementations should expect to be called with the total accumulated value of the counter.

Implementations do not need to be safe for concurrent use.

type Gauge Uses

type Gauge interface {
    Set(total int64)
}

A Gauge models moment-in-time measurements, like a car's speedometer. Implementations should expect to be called with the current value of the gauge.

Implementations do not need to be safe for concurrent use.

type Histogram Uses

type Histogram interface {
    Set(bucket int64, total int64)
}

A Histogram approximates a distribution of values. Implementations should expect to be called with the upper bound of a bucket and the total accumulated number of observations in that bucket.

Implementations do not need to be safe for concurrent use.

type HistogramSpec Uses

type HistogramSpec struct {
    Spec

    Buckets []int64 // upper bounds, inclusive
}

A HistogramSpec configures histograms.

type Spec Uses

type Spec struct {
    Name string
    Tags map[string]string
}

A Spec configures counters and gauges.

type Target Uses

type Target interface {
    NewCounter(Spec) Counter
    NewGauge(Spec) Gauge
    NewHistogram(HistogramSpec) Histogram
}

A Target bridges the metrics package's representations of counters, gauges, and histograms with push-based telemetry systems. Targets are designed to work with the metrics.Root struct's Push method, so they don't need to be safe for concurrent use.

A concrete implementation of this interface that works with StatsD and M3 is available in the go.uber.org/net/metrics/tallypush package.

func NewNop Uses

func NewNop() Target

NewNop returns a no-op Target.

Package push is imported by 2 packages. Updated 2018-09-19. Refresh now. Tools for package owners.