Associate self-managed Prometheus Alerts and Issues
Similar to #32538 (closed), but for self-managed Prometheus.
We need a way to link Issues we create and the Alerts that cause us to create them.
This will be needed before we can achieve
Close GitLab issue on Recovery alerts from Prometheus( #13401) for self-hosted Prometheus.
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 self-managed Prometheus, we don't have any
PrometheusAlerts since they can only be created when you have a Gitlab-Managed Prometheus cluster running via Kubernetes.
Since we don't have an
PrometheusAlert, and because we don't get a
gitlab_alert_id in the payload, we do not currently create a
PrometheusAlertEvent in the database. Since we do not have this, we currently do not have an object to associate the Issue to.
- Create a
PrometheusAlertEvent(or some variant of/something else) anyway, even though theres no alert.
- Something else?