prometheus

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultPrometheusOpts is the default set of options used when creating a
	// PrometheusSink.
	DefaultPrometheusOpts = PrometheusOpts{
		Expiration: 60 * time.Second,
	}
)

Functions

This section is empty.

Types

type PrometheusCounter added in v0.3.4

type PrometheusCounter struct {
	prometheus.Counter
	// contains filtered or unexported fields
}

type PrometheusGauge added in v0.3.4

type PrometheusGauge struct {
	prometheus.Gauge
	// contains filtered or unexported fields
}

type PrometheusOpts

type PrometheusOpts struct {
	// Expiration is the duration a metric is valid for, after which it will be
	// untracked. If the value is zero, a metric is never expired.
	Expiration time.Duration
}

PrometheusOpts is used to configure the Prometheus Sink

type PrometheusPushSink

type PrometheusPushSink struct {
	*PrometheusSink
	// contains filtered or unexported fields
}

func NewPrometheusPushSink

func NewPrometheusPushSink(address string, pushIterval time.Duration, name string) (*PrometheusPushSink, error)

func (*PrometheusPushSink) Shutdown

func (s *PrometheusPushSink) Shutdown()

type PrometheusSink

type PrometheusSink struct {
	// contains filtered or unexported fields
}

func NewPrometheusSink

func NewPrometheusSink() (*PrometheusSink, error)

NewPrometheusSink creates a new PrometheusSink using the default options.

func NewPrometheusSinkFrom

func NewPrometheusSinkFrom(opts PrometheusOpts) (*PrometheusSink, error)

NewPrometheusSinkFrom creates a new PrometheusSink using the passed options.

func (*PrometheusSink) AddSample

func (p *PrometheusSink) AddSample(parts []string, val float32)

func (*PrometheusSink) AddSampleWithLabels

func (p *PrometheusSink) AddSampleWithLabels(parts []string, val float32, labels []metrics.Label)

func (*PrometheusSink) Collect

func (p *PrometheusSink) Collect(c chan<- prometheus.Metric)

Collect meets the collection interface and allows us to enforce our expiration logic to clean up ephemeral metrics if their value haven't been set for a duration exceeding our allowed expiration time.

func (*PrometheusSink) Describe

func (p *PrometheusSink) Describe(c chan<- *prometheus.Desc)

Describe is needed to meet the Collector interface.

func (*PrometheusSink) EmitKey

func (p *PrometheusSink) EmitKey(key []string, val float32)

EmitKey is not implemented. Prometheus doesn’t offer a type for which an arbitrary number of values is retained, as Prometheus works with a pull model, rather than a push model.

func (*PrometheusSink) IncrCounter

func (p *PrometheusSink) IncrCounter(parts []string, val float32)

func (*PrometheusSink) IncrCounterWithLabels

func (p *PrometheusSink) IncrCounterWithLabels(parts []string, val float32, labels []metrics.Label)

func (*PrometheusSink) SetGauge

func (p *PrometheusSink) SetGauge(parts []string, val float32)

func (*PrometheusSink) SetGaugeWithLabels

func (p *PrometheusSink) SetGaugeWithLabels(parts []string, val float32, labels []metrics.Label)

type PrometheusSummary added in v0.3.4

type PrometheusSummary struct {
	prometheus.Summary
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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