Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFqName ¶
ExtractFqName extracts the fqName from a prometheus.Desc string. This is useful for testing collectors.
func ExtractValueFromMetric ¶ added in v1.0.2
func ExtractValueFromMetric(metric prometheus.Metric) (float64, error)
ExtractValueFromMetric extracts the value from a prometheus.Metric object. It creates a custom collector and registry, registers the given metric, and then collects the metric value using the registry. Returns the extracted float64 value from the metric's Gauge.
Types ¶
type SimpleDescHelper ¶
SimpleDescHelper is a helper struct that can be used to create prometheus.Desc objects
func (*SimpleDescHelper) NewDescWithHelp ¶
func (h *SimpleDescHelper) NewDescWithHelp(name string, help string) *prometheus.Desc
NewDescWithHelp creates a new prometheus.Desc with the namespace and subsystem.
func (*SimpleDescHelper) NewDescWithHelpAndLabels ¶ added in v1.1.0
func (h *SimpleDescHelper) NewDescWithHelpAndLabels(name string, help string, labels ...string) *prometheus.Desc
NewDescWithLabel creates a new prometheus.Desc with the namespace and subsystem. Labels are used to differentiate between different sources of the same metric.