push

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 0 Imported by: 2

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

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

type Histogram interface {
	Set(bucket int64, total int64)
	SetIndex(bucketIndex int, 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

type HistogramSpec struct {
	Spec

	Buckets []int64 // upper bounds, inclusive
}

A HistogramSpec configures histograms.

type Spec

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

A Spec configures counters and gauges.

type Target

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

func NewNop() Target

NewNop returns a no-op Target.

Jump to

Keyboard shortcuts

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