Class: AlertManagement::ProcessPrometheusAlertService

Inherits:
Object
  • Object
show all
Extended by:
Gitlab::Utils::Override
Includes:
AlertProcessing, Responses
Defined in:
app/services/alert_management/process_prometheus_alert_service.rb

Instance Method Summary collapse

Methods included from Gitlab::Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Methods included from Responses

#bad_request, #forbidden, #success, #unauthorized, #unprocessable_entity

Methods included from AlertProcessing

#alert, #alert_source, #build_new_alert, #close_issue, #complete_post_processing_tasks, #find_existing_alert, #logger, #notifying_alert?, #process_alert, #process_existing_alert, #process_firing_alert, #process_incident_issues, #process_new_alert, #process_resolved_alert, #send_alert_email

Methods included from IncidentManagement::Settings

#auto_close_incident?, #incident_management_setting, #process_issues?

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

#initialize(project, payload) ⇒ ProcessPrometheusAlertService

Returns a new instance of ProcessPrometheusAlertService.


9
10
11
12
# File 'app/services/alert_management/process_prometheus_alert_service.rb', line 9

def initialize(project, payload)
  @project = project
  @payload = payload
end

Instance Method Details

#executeObject


14
15
16
17
18
19
20
21
22
23
# File 'app/services/alert_management/process_prometheus_alert_service.rb', line 14

def execute
  return bad_request unless incoming_payload.has_required_attributes?

  process_alert
  return bad_request unless alert.persisted?

  complete_post_processing_tasks

  success(alert)
end