Documentation
¶
Index ¶
- func NewMetricSet(name, help string) *metricSet
- func NewPrometheusClient(prometheusURL string) (api.Client, error)
- func NewPrometheusClientWithRoundTripper(prometheusURL string, roundTripper http.RoundTripper) (api.Client, error)
- func NewPrometheusClientWithToken(prometheusURL string, token string) (api.Client, error)
- type Loader
- type Matrix
- type Metric
- type MetricSet
- type Range
- type RangeVector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMetricSet ¶
func NewMetricSet(name, help string) *metricSet
func NewPrometheusClient ¶ added in v1.2.0
func NewPrometheusClientWithRoundTripper ¶ added in v1.2.0
func NewPrometheusClientWithRoundTripper(prometheusURL string, roundTripper http.RoundTripper) (api.Client, error)
NewPrometheusClientWithRoundTripper creates a client using a supplied transport for authentication and TLS.
Types ¶
type Loader ¶
type Loader interface {
LoadQuery(ctx context.Context, query string, t time.Time) ([]model.LabelSet, error)
LoadAlertsRange(ctx context.Context, start, end time.Time, step time.Duration) (RangeVector, error)
LoadVectorRange(ctx context.Context, query string, start, end time.Time, step time.Duration) (RangeVector, error)
}
func NewLoaderWithRoundTripper ¶ added in v1.2.0
func NewLoaderWithRoundTripper(prometheusURL string, roundTripper http.RoundTripper) (Loader, error)
NewLoaderWithRoundTripper creates a loader using a supplied transport.
func NewLoaderWithToken ¶ added in v1.2.0
type Matrix ¶
type Matrix struct {
Metrics []model.LabelSet
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 ¶
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 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