Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Untyped is the metric type of metrics that have no specified type Untyped MetricType = "" // CounterType is a cumulative metric that represents a single monotonically increasing counter whose value can only increase or be reset to zero on restart. CounterType = "counter" // GaugeType is a metric that represents a single numerical value that can arbitrarily go up and down. GaugeType = "gauge" // HistogramType samples observations (usually things like request durations or response sizes) and counts them in configurable buckets. HistogramType = "histogram" // SummaryType samples observations (usually things like request durations and response sizes). While it also provides a total count of observations and a sum of all observed values, it calculates configurable quantiles over a sliding time window. SummaryType = "summary" )
Variables ¶
View Source
var ErrParseFail = fmt.Errorf("failed to parse line")
ErrParseFail is returned when parsing of metrics data fails
View Source
var ErrUnexpectedHTTPStatusCode = fmt.Errorf("unexpected HTTP status code")
ErrUnexpectedHTTPStatusCode is returned when the HTTP status is not 200
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric struct {
Name string
Description string
Type MetricType
Samples []*Sample
}
Metric is a parsed metric from the endpoint.
type MetricType ¶
type MetricType string
MetricType describes the type of the metric that was collected. See https://prometheus.io/docs/concepts/metric_types/
type PromMetricsClient ¶
type PromMetricsClient struct {
URL string
}
PromMetricsClient is a simple client that fetches and parses metrics from a prometheus /metrics endpoint.
func (*PromMetricsClient) GetMetrics ¶
func (c *PromMetricsClient) GetMetrics() ([]*Metric, error)
GetMetrics retrieves metrics from the stored URL
Click to show internal directories.
Click to hide internal directories.