metrics

package
v0.0.0-...-884d78e Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Count

type Count interface {
	// Add adds value "v" to the metric and returns the result.
	Add(v uint64) uint64

	// WithOverriddenTags returns scoped Count with replaced tags to be reported with the metrics.
	//
	// In terms of Prometheus the "tags" are called "labels".
	WithOverriddenTags(Fields) Count
}

Count is a counter metric.

See also https://prometheus.io/docs/concepts/metric_types/

type Fields

type Fields = fields.Fields

type Gauge

type Gauge interface {
	// Add adds value "v" to the metric and returns the result.
	Add(v float64) float64

	// WithOverriddenTags returns scoped Gauge with replaced tags to be reported with the metrics.
	//
	// In terms of Prometheus the "tags" are called "labels".
	WithOverriddenTags(fields.Fields) Gauge
}

Gauge is a float64 gauge metric.

See also https://prometheus.io/docs/concepts/metric_types/

type IntGauge

type IntGauge interface {
	// Add adds value "v" to the metric and returns the result.
	Add(v int64) int64

	// WithOverriddenTags returns scoped IntGauge with replaced tags to be reported with the metrics.
	//
	// In terms of Prometheus the "tags" are called "labels".
	WithOverriddenTags(Fields) IntGauge
}

IntGauge is a int64 gauge metric.

See also https://prometheus.io/docs/concepts/metric_types/

type Metrics

type Metrics interface {
	// Gauge returns the float64 gauge metric with key "key".
	Gauge(key string) Gauge

	// IntGauge returns the int64 gauge metric with key "key".
	IntGauge(key string) IntGauge

	// Count returns the counter metric with key "key".
	Count(key string) Count

	// WithTag returns scoped Metrics with an added tag to be reported with the metrics.
	//
	// In terms of Prometheus the "tags" are called "labels".
	WithTag(key string, value interface{}) Metrics

	// WithTags returns scoped Metrics with added tags to be reported with the metrics.
	//
	// In terms of Prometheus the "tags" are called "labels".
	//
	// Value "nil" resets tags.
	WithTags(fields Fields) Metrics
}

Metrics is a handler of metrics (like Prometheus, ODS)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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