When sending alerts from an existing Prometheus set up (install on multiple k8s clusters using Prometheus operator helm chart.
All alerts send either triggered by API or by Prometheus rules, Gitlab only shows them as “critical” Does anyone have. Sample JSON file with the correct structure, for GitLab to accept the alert level ?
JSON_STRING=$$( jq -n \
--arg projectname "$${CI_PROJECT_NAME}" \
--arg environment "$${ENVIRONMENT}" \
--arg alert_starts_date $${ALERT_STARTS_DATE} \
--arg alert_resolve_date $${ALERT_RESOLVED_DATE} \
'[{labels:{\
alertname: "Drift Detection",\
gitlab_project: $$projectname,\
environment: $$environment,\
gitlab_environment_name: "production",\
severity: "warning"},\
annotations:{\
title: "Drift Detection",\
description: "Terraform Drift Detection"},\
startsAt: $$alert_starts_date,\
endsAt: $$alert_resolve_date,\
generatorURL: "http://prometheus-operated.monitor.svc.cluster.local:9090"}]' )