Versions in this module Expand all Collapse all v0 v0.1.0 Oct 9, 2024 Changes in this version + func NewMetricSet(name, help string) *metricSet + func PromMetricToString(m PromMetric) string + type Alert struct + Labels map[string]string + Name string + func (a Alert) MLabels() map[string]string + func (a Alert) String() string + type LabelSet struct + Labels map[string]string + func (ls LabelSet) MLabels() map[string]string + type Loader struct + func NewLoader(prometheusURL string) (*Loader, error) + 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 struct + End model.Time + Metrics []PromMetric + Start model.Time + Step time.Duration + Values [][]model.SampleValue + type Metric struct + Labels prom.Labels + Value float64 + type MetricSet interface + Update func(metrics []Metric) + type PromMetric interface + MLabels func() map[string]string + type Range struct + Metric PromMetric + Samples []model.SamplePair + Step time.Duration + type RangeVector []Range + func (v RangeVector) Expand() Matrix + func (v RangeVector) MaxTime() model.Time + func (v RangeVector) MinTime() model.Time