alertbackfill

package
v0.0.85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGroupAndAlert

func FindGroupAndAlert(groups []*rules.Group, matchers []*labels.Matcher) (string, *rules.AlertingRule, time.Duration)

func GenerateAlertStateMatrix

func GenerateAlertStateMatrix(v model.Matrix, matchers []*labels.Matcher, alertLabels labels.Labels, step time.Duration) model.Matrix

GenerateAlertStateMatrix will generate the a model.Matrix which is the equivalent of the `ALERTS_FOR_STATE` series that would have been generated for the given data

func StringsToWarnings

func StringsToWarnings(ins []string) storage.Warnings

TODO: move to a util package?

Types

type AlertBackfillQuerier

type AlertBackfillQuerier struct {
	// contains filtered or unexported fields
}

AlertBackfillQuerier will Query a downstream storage.Queryable for the ALERTS_FOR_STATE series, if that series is not found -- it will then run the appropriate query_range equivalent to re-generate the data.

func (*AlertBackfillQuerier) Close

func (q *AlertBackfillQuerier) Close() error

func (*AlertBackfillQuerier) LabelNames

func (q *AlertBackfillQuerier) LabelNames(matchers ...*labels.Matcher) ([]string, storage.Warnings, error)

func (*AlertBackfillQuerier) LabelValues

func (q *AlertBackfillQuerier) LabelValues(name string, matchers ...*labels.Matcher) ([]string, storage.Warnings, error)

func (*AlertBackfillQuerier) Select

func (q *AlertBackfillQuerier) Select(sortSeries bool, hints *storage.SelectHints, matchers ...*labels.Matcher) storage.SeriesSet

Select will fetch and return the ALERTS_FOR_STATE series for the given matchers

type AlertBackfillQueryable

type AlertBackfillQueryable struct {
	// contains filtered or unexported fields
}

AlertBackfillQueryable returns a storage.Queryable that will handle returning results for the RuleManager alert backfill. This is done by first attempting to query the downstream store and if no result is found it will "recreate" the the series by re-running the necessary query to get the data back

func NewAlertBackfillQueryable

func NewAlertBackfillQueryable(e *promql.Engine, q storage.Queryable) *AlertBackfillQueryable

NewAlertBackfillQueryable returns a new AlertBackfillQueryable

func (*AlertBackfillQueryable) Querier

func (q *AlertBackfillQueryable) Querier(ctx context.Context, mint, maxt int64) (storage.Querier, error)

Querier returns an AlertBackfillQuerier

func (*AlertBackfillQueryable) SetRuleGroupFetcher

func (q *AlertBackfillQueryable) SetRuleGroupFetcher(f RuleGroupFetcher)

SetRuleGroupFetcher sets the RuleGroupFetcher -- this is required as we need the groups to find the correct step interval

type RuleGroupFetcher

type RuleGroupFetcher func() []*rules.Group

RuleGroupFetcher defines a method to fetch []*rules.Group

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL