Skip to content

Move shared alert processing logic to concern

Sarah Yasonik requested to merge sy-refactor-notify-services into master

What does this MR do?

As part of #262866 (closed), we'll need to add functionality to email on-call users when an alert comes in.

As ^^this is an EE feature, we'd need to extend the relevant class with EE modules (AlertManagement::ProcessPrometheusAlertService and Projects::Alerting::NotifyService). Currently, these two classes (along with AlertManagement::NetworkAlertService) have a lot of shared logic.

To avoid creating duplicate EE extension modules for each class, I opted to isolate the shared functionality. This will allow me to extend only the shared module in the feature MR. This will also reduce duplication and make it easier to use this logic again in future.

Changes:

  • Move shared logic to AlertManagement::AlertProcessing module
  • Introduce error-case logging for Projects::Alerting::NotifyService
  • Include the monitoring tool/source of an alert in log when failing to save the alert

No changelog entry will be included, as none of the changes here are user-facing.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Sarah Yasonik

Merge request reports