Documentation ¶
Index ¶
- type Client
- func (in *Client) FetchHistogramRange(metricName, labels, grouping string, q *MetricsQuery) Histogram
- func (in *Client) FetchRange(metricName, labels, grouping, aggregator string, q *MetricsQuery) Metric
- func (in *Client) FetchRateRange(metricName, labels, grouping string, q *MetricsQuery) Metric
- func (in *Client) GetMetricsForLabels(labels []string) ([]string, error)
- type ClientInterface
- type Histogram
- type Metric
- type Metrics
- type MetricsQuery
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ClientInterface // contains filtered or unexported fields }
Client for Prometheus API. It hides the way we query Prometheus offering a layer with a high level defined API.
func NewClient ¶
func NewClient(cfg extconfig.PrometheusConfig) (*Client, error)
NewClient creates a new client to the Prometheus API. It returns an error on any problem.
func (*Client) FetchHistogramRange ¶
func (in *Client) FetchHistogramRange(metricName, labels, grouping string, q *MetricsQuery) Histogram
FetchHistogramRange fetches bucketed metric as histogram in given range
func (*Client) FetchRange ¶
func (in *Client) FetchRange(metricName, labels, grouping, aggregator string, q *MetricsQuery) Metric
FetchRange fetches a simple metric (gauge or counter) in given range
func (*Client) FetchRateRange ¶
func (in *Client) FetchRateRange(metricName, labels, grouping string, q *MetricsQuery) Metric
FetchRateRange fetches a counter's rate in given range
type ClientInterface ¶
type ClientInterface interface { FetchHistogramRange(metricName, labels, grouping string, q *MetricsQuery) Histogram FetchRange(metricName, labels, grouping, aggregator string, q *MetricsQuery) Metric FetchRateRange(metricName, labels, grouping string, q *MetricsQuery) Metric GetMetricsForLabels(labels []string) ([]string, error) }
type Metric ¶
Metric holds the Prometheus Matrix model, which contains one or more time series (depending on grouping)
type Metrics ¶
type Metrics struct { Metrics map[string]*Metric `json:"metrics"` Histograms map[string]Histogram `json:"histograms"` }
Metrics contains all simple metrics and histograms data
type MetricsQuery ¶
type MetricsQuery struct { v1.Range RateInterval string RateFunc string Quantiles []string Avg bool ByLabels []string }
MetricsQuery holds common parameters for all kinds of queries
func (*MetricsQuery) FillDefaults ¶
func (q *MetricsQuery) FillDefaults()
FillDefaults fills the struct with default parameters