diff options
Diffstat (limited to 'app/services/alert_management')
-rw-r--r-- | app/services/alert_management/process_prometheus_alert_service.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/services/alert_management/process_prometheus_alert_service.rb b/app/services/alert_management/process_prometheus_alert_service.rb index 28ce5401a6c..753162bfdbf 100644 --- a/app/services/alert_management/process_prometheus_alert_service.rb +++ b/app/services/alert_management/process_prometheus_alert_service.rb @@ -1,10 +1,16 @@ # frozen_string_literal: true module AlertManagement - class ProcessPrometheusAlertService < BaseService + class ProcessPrometheusAlertService + include BaseServiceUtility include Gitlab::Utils::StrongMemoize include ::IncidentManagement::Settings + def initialize(project, payload) + @project = project + @payload = payload + end + def execute return bad_request unless incoming_payload.has_required_attributes? @@ -19,6 +25,8 @@ module AlertManagement private + attr_reader :project, :payload + def process_alert_management_alert if incoming_payload.resolved? process_resolved_alert_management_alert @@ -127,7 +135,7 @@ module AlertManagement strong_memoize(:incoming_payload) do Gitlab::AlertManagement::Payload.parse( project, - params, + payload, monitoring_tool: Gitlab::AlertManagement::Payload::MONITORING_TOOLS[:prometheus] ) end |