Associate Generic Alerts and Issues
This is needed before we can achieve:
- Auto recovery of generic alerts (#13402)
- Metrics such as counting the number of times a Generic Alert has fired. (This could be done with a count on the Alert Event, or whatever we end up creating).
We need a way to link Issues we create and the Alerts that cause us to create them.
For Gitlab-managed Prometheus, we have the following models to help achieve this:
PrometheusAlert, which is created via the Metrics dashboard
PrometheusAlertEventwhich we create when we receive an alert Payload from Prometheus.
Issuewhich we also create as a result of receiving the alert Payload from Prometheus
For Generic alerts, we don't have any
Alerts, and so nothing to create the events off and associate with the Issues.
Right now, we simply create the Issues with no way to link back to the alert that created them.
- Create some kind of
AlertEventfor these? We'll need to infer uniqueness from the generic alerts for this to work.
- Something else?