Versions in this module Expand all Collapse all v1 v1.7.2 Feb 15, 2018 Changes in this version + type Alert struct + ActiveAt time.Time + Annotations labels.Labels + FiredAt time.Time + Labels labels.Labels + ResolvedAt time.Time + State AlertState + Value float64 + type AlertState int + const StateFiring + const StateInactive + const StatePending + func (s AlertState) String() string + type AlertingRule struct + func NewAlertingRule(name string, vec promql.Expr, hold time.Duration, lbls, anns labels.Labels, ...) *AlertingRule + func (r *AlertingRule) ActiveAlerts() []*Alert + func (r *AlertingRule) Eval(ctx context.Context, ts time.Time, query QueryFunc, externalURL *url.URL) (promql.Vector, error) + func (r *AlertingRule) GetEvaluationTime() time.Duration + func (r *AlertingRule) HTMLSnippet(pathPrefix string) html_template.HTML + func (r *AlertingRule) Name() string + func (r *AlertingRule) SetEvaluationTime(dur time.Duration) + func (r *AlertingRule) State() AlertState + func (r *AlertingRule) String() string + type Appendable interface + Appender func() (storage.Appender, error) + type Group struct + func NewGroup(name, file string, interval time.Duration, rules []Rule, opts *ManagerOptions) *Group + func (g *Group) Eval(ctx context.Context, ts time.Time) + func (g *Group) File() string + func (g *Group) GetEvaluationTime() time.Duration + func (g *Group) Name() string + func (g *Group) Rules() []Rule + func (g *Group) SetEvaluationTime(dur time.Duration) + type Manager struct + func NewManager(o *ManagerOptions) *Manager + func (m *Manager) AlertingRules() []*AlertingRule + func (m *Manager) Collect(ch chan<- prometheus.Metric) + func (m *Manager) Describe(ch chan<- *prometheus.Desc) + func (m *Manager) RuleGroups() []*Group + func (m *Manager) Rules() []Rule + func (m *Manager) Run() + func (m *Manager) Stop() + func (m *Manager) Update(interval time.Duration, files []string) error + type ManagerOptions struct + Appendable Appendable + Context context.Context + ExternalURL *url.URL + Logger log.Logger + NotifyFunc NotifyFunc + QueryFunc QueryFunc + Registerer prometheus.Registerer + type NotifyFunc func(ctx context.Context, expr string, alerts ...*Alert) error + type QueryFunc func(ctx context.Context, q string, t time.Time) (promql.Vector, error) + func EngineQueryFunc(engine *promql.Engine, q storage.Queryable) QueryFunc + type RecordingRule struct + func NewRecordingRule(name string, vector promql.Expr, lset labels.Labels) *RecordingRule + func (rule *RecordingRule) Eval(ctx context.Context, ts time.Time, query QueryFunc, _ *url.URL) (promql.Vector, error) + func (rule *RecordingRule) GetEvaluationTime() time.Duration + func (rule *RecordingRule) HTMLSnippet(pathPrefix string) template.HTML + func (rule *RecordingRule) Name() string + func (rule *RecordingRule) SetEvaluationTime(dur time.Duration) + func (rule *RecordingRule) String() string + type Rule interface + Eval func(context.Context, time.Time, QueryFunc, *url.URL) (promql.Vector, error) + GetEvaluationTime func() time.Duration + HTMLSnippet func(pathPrefix string) html_template.HTML + Name func() string + SetEvaluationTime func(time.Duration) + String func() string