VictoriaMetrics/app/vmalert
Roman Khavronenko 9f8cc8ae1b
Extend web responses for alerts: (#411)
vmalert: Extend web responses for alerts

* populate apiAlert object with additional fields
* return all active alerts, not only firing
* sort list of API alerts for deterministic output
* add helper for available path list
2020-04-11 16:49:23 +01:00
..
datasource Vmalert/rules eval (#400) 2020-04-06 14:44:03 +03:00
notifier [vmalert] add webserver (#410) 2020-04-11 12:40:24 +03:00
testdata [vmalert] add webserver (#410) 2020-04-11 12:40:24 +03:00
config.go Vmalert/rules eval (#400) 2020-04-06 14:44:03 +03:00
config_test.go Vmalert/rules eval (#400) 2020-04-06 14:44:03 +03:00
main.go Extend web responses for alerts: (#411) 2020-04-11 16:49:23 +01:00
README.md [vmalert] add vmalert.png.2 2020-02-02 12:17:19 +02:00
rule.go Extend web responses for alerts: (#411) 2020-04-11 16:49:23 +01:00
rule_test.go Vmalert/rules eval (#400) 2020-04-06 14:44:03 +03:00
vmalert.png [vmalert] initial 2020-02-02 12:14:09 +02:00
web.go Extend web responses for alerts: (#411) 2020-04-11 16:49:23 +01:00

VM Alert

Abstract

The application which accepts the alert rules, executes them on given source, sends(fires) an alert to(in) alert management system

Components

Alert Config Reader

It accepts yaml config as input parameter in Prometheus format, parses it into Go struct.

Source Caller

Create own watchdog for every alert group (goroutines), which executes alert query on given source and issues an alert if source returns non-empty result. Source can be any service which supports PromQL (MetricsQL).

Alert Management System Provider

Send positive alert to alert management system, provides interface for every concrete implementation. Should be ingratiated with Prometheus alertmanager.

open questions:

  • do we really need alert group or can just run every alert in own goroutine?

Web Server

Expose metrics

open questions:

  • should the tool provide API or UI for managing alerting rules? Where to store config updated via the API or UI?
  • should the tool provide “alerting rules validation mode” for validating and debugging alerting rules? This mode is useful when creating and debugging alerting rules.

Requirements:

  • Stateless
  • Avoid external dependencies if possible
  • Reuse existing code from VictoriaMetrics repo
  • Makefile rules for common tasks see Makefiles for other apps in the app/ dir
  • Every package should be covered by tests
  • Dockerfile
  • Graceful shutdown
  • Helm template
  • Application uses command line flags for configuration
VM Alert