metrics

package
v0.0.0-...-7e76064 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// ResourcesMetricName is the name of the Prometheus metric used to monitor Boskos resources.
	ResourcesMetricName = "boskos_resources"
	// ResourcesMetricDescription is the description for the Prometheus metric used to monitor Boskos resources.
	ResourcesMetricDescription = "Number of resources recorded in Boskos by resource type and state."
)

Variables

View Source
var (
	// ResourcesMetricLabels is the list of labels used for the Prometheus metric used to monitor Boskos resources.
	ResourcesMetricLabels = []string{"type", "state"}
)

Functions

func NewResourcesCollector

func NewResourcesCollector(ranch *ranch.Ranch) prometheus.Collector

NewResourcesCollector returns a collector which exports the current counts of Boskos resources, segmented by resource type and state.

func NormalizeResourceMetrics

func NormalizeResourceMetrics(metrics []common.Metric, states []string, updateFunc func(rtype, state string, count float64))

NormalizeResourceMetrics "normalizes" the list of provided Metrics by bucketing any state not in states into the "Other" state, and by ensuring every state in states has some count (even if zero). It then applies the function for each combination of resource type and state.

Types

This section is empty.

Jump to

Keyboard shortcuts

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