Skip to content

Map common severity values from a Prometheus alert payload

Peter Leitzen requested to merge map-prometheus-payload-severity into master

What does this MR do?

This MR adds the ability to map Prometheus specific severity in alert payload located in labels.severity to GitLab alert severity.

Severity Value Mapping

Severity is matched case-insensitive so one can provide CRITICAL or iNfO.

Refs https://gitlab.com/gitlab-com/gl-infra/infrastructure/-/issues/12238

Alertmanager Payload labels/severity Mapped to Alert severity
critical, s1, p1, emergency, fatal critical
high, s2, p2, major, page high
medium, s3, p3, error, alert medium
low, s4, p4, warn, warning low
info, s5, p5, debug, information, notice info
something unmapped nil (or critical implicitly¹)
missing nil (or critical implicitly¹)

¹If a severity is missing or unknown we map to nil which defaults to critical (DEFAULT 0)

Screenshots (strongly suggested)

Before After Alert details
Screenshot_2021-01-21_Alerts___Administrator_manual_prometheus_2_ Screenshot_2021-01-21_Alerts___Administrator_manual_prometheus_1_ Screenshot_from_2021-01-19_19-20-47

Does this MR meet the acceptance criteria?

Conformity

Edited by Peter Leitzen

Merge request reports