Automatic created Ngnix alert after Prometheus install (1/2)
What does this MR do?
This adds the ability to create Prometheus alerts automatically after the Prometheus service is added.
The Prometheus service can be added by:
Creating the alerts after the service has first been created allows us to target both of these user flows.
Note this covers one of the metrics required in the proposal (in bold). The other will be added in a later MR:
Proposal
For newly created projects, as soon as a user installs Prometheus on their Cluster, two default metrics would have the following alerts applied:
- On the Throughput metric, add an alert to auto-monitoring in Auto DevOps when 5xx status codes ≥ 0.1% for 10 minutes
- On the HTTP error rate metric, add an alert to auto-monitoring in Auto DevOps when 5xx errors ≥ 0.1% for 10 minutes
Screenshots
Metric added
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry - [-] Documentation (if required) see #213619 (closed)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
This can be tested by:
- Creating a Project
- Add a Cluster
- Install Prometheus
- Deploy a project that has a web server, and go to the URL (For example this project https://gitlab.com/joshlambert/autodevops-deploy)
Related to #118788 (closed)
Edited by Peter Leitzen