metrics

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CounterForLabels

func CounterForLabels(metricName string, labels map[string]string, metrics map[string]*dto.MetricFamily) (int, error)

CounterForLabels retrieves the value of the Counter matching the given set of labels.

func ForPod

func ForPod(source, target *corev1.Pod, namespace string) ([]map[string]*dto.MetricFamily, error)

MetricsForPod returns the parsed metrics for the given pod, scraping them from the source pod.

func GaugeForLabels

func GaugeForLabels(metricName string, labels map[string]string, metrics map[string]*dto.MetricFamily) (int, error)

GaugeForLabels retrieves the value of the Gauge matching the given set of labels.

func GreaterThan added in v0.13.0

func GreaterThan(min int) func(value int) error

func ValidateCounterValue added in v0.12.0

func ValidateCounterValue(check func(int) error, metricName string, labels map[string]string, allMetrics []map[string]*dto.MetricFamily) error

ValidateCounterValue checks that the value related to the given metric is at most the expectedMax value.

func ValidateGaugeValue added in v0.12.0

func ValidateGaugeValue(expectedValue int, metricName string, labels map[string]string, allMetrics []map[string]*dto.MetricFamily) error

ValidateGaugeValue checks that the value corresponing to the given metric is the same as expected value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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