metrics

package
v0.0.0-...-33a4775 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MaxMetricsBufferedSize = 1024 * 1024

Variables

This section is empty.

Functions

func Handler

func Handler() http.HandlerFunc

func WithDuration

func WithDuration[T FactoryTypeGauge](f FactoryGauge[T], v T) func()

Types

type Collector

type Collector interface {
	MCollector
	DCollector
}

type Counter

type Counter interface {
	Metric
}

type DCollector

type DCollector interface {
	CollectDescriptions(in PushDescription)
}

type Description

type Description interface {
	Desc() *prometheus.Desc
	Labels(labels ...string) []*dto.LabelPair

	Collect(out chan<- prometheus.Metric, collect func(p Producer) error)

	Gauge(value float64, labels ...string) Metric
	Counter(value float64, labels ...string) Metric
}

func NewDescription

func NewDescription(fqName, help string, variableLabels []string, constLabels prometheus.Labels) Description

type Error

type Error interface {
	Metric
}

type FactoryCounter

type FactoryCounter[T FactoryTypeCounter] interface {
	Collector

	Items() []T
	Get(v T) float64
	Remove(v T)
	Add(v T, value float64)
	Inc(v T)
}

func NewFactoryCounter

func NewFactoryCounter[T FactoryTypeCounter]() FactoryCounter[T]

type FactoryGauge

type FactoryGauge[T FactoryTypeGauge] interface {
	Collector

	Items() []T
	Get(v T) float64
	Remove(v T)
	Set(v T, value float64)
	Add(v T, value float64)
}

func NewFactoryGauge

func NewFactoryGauge[T FactoryTypeGauge]() FactoryGauge[T]

type FactoryTypeCounter

type FactoryTypeCounter interface {
	comparable

	Desc() Description
	Counter(value float64) Metric
}

type FactoryTypeGauge

type FactoryTypeGauge interface {
	comparable

	Desc() Description
	Gauge(value float64) Metric
}

type Gauge

type Gauge interface {
	Metric
}

type MCollector

type MCollector interface {
	CollectMetrics(in PushMetric)
}

type Metric

type Metric interface {
	prometheus.Metric
}

type MetricPushFilter

type MetricPushFilter func(m Metric) bool

func MergeMetricPushFilter

func MergeMetricPushFilter(filters ...MetricPushFilter) MetricPushFilter

func NegateMetricPushFilter

func NegateMetricPushFilter(in MetricPushFilter) MetricPushFilter

func NewPrefixMetricPushFilter

func NewPrefixMetricPushFilter(prefixes ...string) MetricPushFilter

type Producer

type Producer interface {
	Gauge(value float64, labels ...string) Producer
}

type PushDescription

type PushDescription interface {
	Push(desc ...Description) PushDescription
}

func NewPushDescription

func NewPushDescription(out chan<- *prometheus.Desc) PushDescription

type PushMetric

type PushMetric interface {
	Push(desc ...Metric) PushMetric
}

func NewMetricsPushFilter

func NewMetricsPushFilter(out PushMetric, filter MetricPushFilter) PushMetric

func NewPushMetric

func NewPushMetric(out chan<- prometheus.Metric) PushMetric

Jump to

Keyboard shortcuts

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