Documentation ¶
Index ¶
- func NewMetricSet(name, help string) *metricSet
- func PromMetricToString(m PromMetric) string
- type Alert
- type LabelSet
- type Loader
- func (c Loader) LoadAlerts(ctx context.Context, t time.Time) ([]Alert, error)
- func (c Loader) LoadAlertsRange(ctx context.Context, start, end time.Time, step time.Duration) (RangeVector, error)
- func (c Loader) LoadVectorRange(ctx context.Context, query string, start, end time.Time, step time.Duration) (RangeVector, error)
- type Matrix
- type Metric
- type MetricSet
- type PromMetric
- type Range
- type RangeVector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetricSet ¶
func NewMetricSet(name, help string) *metricSet
func PromMetricToString ¶
func PromMetricToString(m PromMetric) string
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
func (Loader) LoadAlerts ¶
func (Loader) LoadAlertsRange ¶
type Matrix ¶
type Matrix struct { Metrics []PromMetric Values [][]model.SampleValue Start model.Time End model.Time Step time.Duration }
Matrix is a dense matrix of time series aligned by time.
type MetricSet ¶
type MetricSet interface { prometheus.Collector Update(metrics []Metric) }
MetricSet is an expasion of prometheus.Collector interface that allows batch updates of metrics. Useful when processing a set of metrics that are later exposed to Prometheus via different metric.
type PromMetric ¶
TODO: Replace with LabelSet and get rid of Alerts struct
- it's unnecessary complex.
type Range ¶
type Range struct { Metric PromMetric Samples []model.SamplePair Step time.Duration }
type RangeVector ¶
type RangeVector []Range
func (RangeVector) Expand ¶
func (v RangeVector) Expand() Matrix
Expand converts a RangeVector to a dense Matrix.
The dense matrix is quite an expensive structure. We initially used it for searching for alerts changes, but we used interval-based approach instead. We keep this function for possible future use.
func (RangeVector) MaxTime ¶
func (v RangeVector) MaxTime() model.Time
func (RangeVector) MinTime ¶
func (v RangeVector) MinTime() model.Time
Click to show internal directories.
Click to hide internal directories.