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.
Click to show internal directories.
Click to hide internal directories.