Documentation ¶
Index ¶
- func CounterForLabels(metricName string, labels map[string]string, ...) (int, error)
- func ForPod(controller, target *corev1.Pod, namespace string) ([]map[string]*dto.MetricFamily, error)
- func GaugeForLabels(metricName string, labels map[string]string, ...) (int, error)
- func GreaterOrEqualThan(min int) func(value int) error
- func PrometheusPod(cs clientset.Interface, namespace string) (*corev1.Pod, error)
- func ValidateCounterValue(check func(int) error, metricName string, labels map[string]string, ...) error
- func ValidateGaugeValue(expectedValue int, metricName string, labels map[string]string, ...) error
- func ValidateGaugeValueCompare(check func(int) error, metricName string, labels map[string]string, ...) error
- func ValidateOnPrometheus(prometheusPod *corev1.Pod, query string, expected CheckType) error
- type CheckType
- type PrometheusResponse
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(controller, 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 GreaterOrEqualThan ¶ added in v0.13.10
func PrometheusPod ¶ added in v0.13.5
PrometheusPod returns a prometheus pod.
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 corresponding to the given metric is the same as expected value.
func ValidateGaugeValueCompare ¶ added in v0.13.10
func ValidateGaugeValueCompare(check func(int) error, metricName string, labels map[string]string, allMetrics []map[string]*dto.MetricFamily) error
ValidateGaugeValueCompare checks that the value corresponding to the given metric against the given compare function.
Types ¶
type PrometheusResponse ¶ added in v0.13.5
type PrometheusResponse struct { Status string `json:"status"` Data prometheusResponseData `json:"data"` }
Click to show internal directories.
Click to hide internal directories.