diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/workers/incident_management | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/workers/incident_management')
-rw-r--r-- | app/workers/incident_management/process_prometheus_alert_worker.rb | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/app/workers/incident_management/process_prometheus_alert_worker.rb b/app/workers/incident_management/process_prometheus_alert_worker.rb index 768e049c60e..e405bc2c2d2 100644 --- a/app/workers/incident_management/process_prometheus_alert_worker.rb +++ b/app/workers/incident_management/process_prometheus_alert_worker.rb @@ -41,23 +41,11 @@ module IncidentManagement end def find_gitlab_managed_event(alert) - payload_key = payload_key_for_alert(alert) - - PrometheusAlertEvent.find_by_payload_key(payload_key) + PrometheusAlertEvent.find_by_payload_key(alert.gitlab_fingerprint) end def find_self_managed_event(alert) - payload_key = payload_key_for_alert(alert) - - SelfManagedPrometheusAlertEvent.find_by_payload_key(payload_key) - end - - def payload_key_for_alert(alert) - if alert.gitlab_managed? - PrometheusAlertEvent.payload_key_for(alert.metric_id, alert.starts_at_raw) - else - SelfManagedPrometheusAlertEvent.payload_key_for(alert.starts_at_raw, alert.title, alert.full_query) - end + SelfManagedPrometheusAlertEvent.find_by_payload_key(alert.gitlab_fingerprint) end def create_issue(project, alert) |