Skip to content

Allow generic alerts to set gitlab environment

Sean Arnold requested to merge 238485-generic-alert-environment into master

What does this MR do?

This adds the ability to associate a [non-prometheus] AlertManagement::Alert with an Environment.

By providing the gitlab_environment_name in the Payload, we will attempt to match an environment for the project by the given name, and associate that to the Alert. This variable name matches the existing name we use for Prometheus alerts (https://docs.gitlab.com/ee/operations/metrics/alerts.html#external-prometheus-instances).

Note: Prometheus alerts are already able to be associated via the Prometheus Alert (metric alert), or in External instances using the same key in the labels object of the alert payload. See https://docs.gitlab.com/ee/operations/metrics/alerts.html#external-prometheus-instances

Screenshots

2020-08-19_14.53.16

Does this MR meet the acceptance criteria?

Conformity

Closes #238485 (closed)

Edited by Sean Arnold

Merge request reports