evaluator

package
v0.0.0-...-22039ab Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: Zlib Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DataDir             string
	EndpointID          portainer.EndpointID
	ScrapeTarget        string
	AlertmanagerTarget  string
	AlertmanagerHeaders map[string]string
	ScrapeInterval      time.Duration // default: 60s
	InsecureSkipVerify  bool
}

Config holds the configuration for the alert evaluator.

type Service

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

Service embeds a Prometheus TSDB + rules.Manager for local alert rule evaluation.

func New

func New(cfg Config) (*Service, error)

New opens a TSDB under dataDir and wires up a Prometheus rules.Manager.

func (*Service) AlertState

func (s *Service) AlertState() []pkgmetrics.EdgeAlertRuleState

AlertState returns the current evaluation state for each alerting rule managed by this evaluator. This is intended for inclusion in the edge agent's poll request so the server can track rule health.

func (*Service) ReloadRules

func (s *Service) ReloadRules(alertsFilePath string) error

ReloadRules updates the active rule set from a YAML file on disk. Pass an empty string to clear all rules.

func (*Service) Start

func (s *Service) Start()

Start begins rule evaluation and the scrape manager in the background.

func (*Service) Stop

func (s *Service) Stop()

Stop halts the scrape manager, rule evaluation, and closes the TSDB.

Jump to

Keyboard shortcuts

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