VictoriaMetrics/app/vmalert/notifier
Roman Khavronenko 2b59fff526
vmalert: fix labels and annotations processing for alerts (#2403)
To improve compatibility with Prometheus alerting the order of
templates processing has changed.
Before, vmalert did all labels processing beforehand. It meant
all extra labels (such as `alertname`, `alertgroup` or rule labels)
were available in templating. All collisions were resolved in favour
of extra labels.
In Prometheus, only labels from the received metric are available in
templating, so no collisions are possible.
This change makes vmalert's behaviour similar to Prometheus.

For example, consider alerting rule which is triggered by time series
with `alertname` label. In vmalert, this label would be overriden
by alerting rule's name everywhere: for alert labels, for annotations, etc.
In Prometheus, it would be overriden for alert's labels only, but in annotations
the original label value would be available.

See more details here https://github.com/prometheus/compliance/issues/80

Signed-off-by: hagen1778 <roman@victoriametrics.com>
2022-04-06 20:24:45 +02:00
..
testdata vmalert: support configuration file for notifiers (#2127) 2022-02-02 14:11:41 +02:00
alert.go vmalert: fix labels and annotations processing for alerts (#2403) 2022-04-06 20:24:45 +02:00
alert_test.go vmalert: fix labels and annotations processing for alerts (#2403) 2022-04-06 20:24:45 +02:00
alertmanager.go Issue-1824: added flags and different auth types support (#2287) 2022-03-10 13:09:12 +02:00
alertmanager_request.qtpl Support of custom URL path for alert (#560) 2020-06-21 11:32:46 +01:00
alertmanager_request.qtpl.go Support of custom URL path for alert (#560) 2020-06-21 11:32:46 +01:00
alertmanager_test.go vmalert: support configuration file for notifiers (#2127) 2022-02-02 14:11:41 +02:00
config.go lib/promscrape: support prometheus-like duration in scrape configs (#2169) 2022-02-11 16:17:00 +02:00
config_test.go vmalert: support configuration file for notifiers (#2127) 2022-02-02 14:11:41 +02:00
config_watcher.go Consul SD - update services on the watcher's start (#2202) 2022-02-21 15:32:45 +02:00
config_watcher_test.go Consul SD - update services on the watcher's start (#2202) 2022-02-21 15:32:45 +02:00
init.go Issue-1824: added flags and different auth types support (#2287) 2022-03-10 13:09:12 +02:00
notifier.go vmalert: support configuration file for notifiers (#2127) 2022-02-02 14:11:41 +02:00
package_test.go Support of custom URL path for alert (#560) 2020-06-21 11:32:46 +01:00
template_func.go Vmalert compliance improvements (#2320) 2022-03-15 11:54:53 +00:00