Documentation
¶
Index ¶
- func GetMetric(url, name string, labels map[string]string) (*io_prometheus_client.Metric, error)
- func GetMetrics(url string) (map[string]*io_prometheus_client.MetricFamily, error)
- func ParseReaderMetrics(input io.Reader) (map[string]*io_prometheus_client.MetricFamily, error)
- func ParseStringMetrics(input string) (map[string]*io_prometheus_client.MetricFamily, error)
- func SelectMetric(metrics map[string]*io_prometheus_client.MetricFamily, name string, ...) (*io_prometheus_client.Metric, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMetric ¶
GetMetric is a convenience function to issue a web request to the specified url and then select a particular metric that exactly matches the name and labels. The metric is then returned and values can be retrieved based on what type of metric it is, for example .GetCounter().GetValue()
func GetMetrics ¶
func GetMetrics(url string) (map[string]*io_prometheus_client.MetricFamily, error)
GetMetrics issues a web request to the specified url and parses any metrics returned
func ParseReaderMetrics ¶
func ParseReaderMetrics(input io.Reader) (map[string]*io_prometheus_client.MetricFamily, error)
func ParseStringMetrics ¶
func ParseStringMetrics(input string) (map[string]*io_prometheus_client.MetricFamily, error)
func SelectMetric ¶
func SelectMetric(metrics map[string]*io_prometheus_client.MetricFamily, name string, matchLabels map[string]string) (*io_prometheus_client.Metric, error)
SelectMetric retrieves a particular metric from a map of MetricFamily based on the name (key) and the provided label kv pairs. Every label kv pair on the metric must match for it to be returned For example, to match the following metric: my_metric{a="1",b="udp"} 7 name must be "my_metric", and the map of matchLabels must be exactly {"a": "1", "b": "udp"}
Types ¶
This section is empty.