Move shared alert processing logic to concern
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
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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