VictoriaMetrics/app/vmalert/notifier
Roman Khavronenko 4de1b2b74a
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-07 15:24:06 +03:00
..
testdata vmalert: support configuration file for notifiers (#2127) 2022-02-02 23:42:25 +02:00
alert_test.go vmalert: fix labels and annotations processing for alerts (#2403) 2022-04-07 15:24:06 +03:00
alert.go vmalert: fix labels and annotations processing for alerts (#2403) 2022-04-07 15:24:06 +03:00
alertmanager_request.qtpl Support of custom URL path for alert (#560) 2020-06-21 16:33:58 +03:00
alertmanager_request.qtpl.go Support of custom URL path for alert (#560) 2020-06-21 16:33:58 +03:00
alertmanager_test.go vmalert: support configuration file for notifiers (#2127) 2022-02-02 23:42:25 +02:00
alertmanager.go Issue-1824: added flags and different auth types support (#2287) 2022-03-16 12:52:01 +02:00
config_test.go vmalert: support configuration file for notifiers (#2127) 2022-02-02 23:42:25 +02:00
config_watcher_test.go Consul SD - update services on the watcher's start (#2202) 2022-02-21 15:33:33 +02:00
config_watcher.go Consul SD - update services on the watcher's start (#2202) 2022-02-21 15:33:33 +02:00
config.go lib/promscrape: support prometheus-like duration in scrape configs (#2169) 2022-02-11 16:17:51 +02:00
init.go Issue-1824: added flags and different auth types support (#2287) 2022-03-16 12:52:01 +02:00
notifier.go vmalert: support configuration file for notifiers (#2127) 2022-02-02 23:42:25 +02:00
package_test.go Support of custom URL path for alert (#560) 2020-06-21 16:33:58 +03:00
template_func.go Vmalert compliance improvements (#2320) 2022-03-16 13:22:26 +02:00