Add possiblity to set CLUSTER_ID via env var
- mitigate missing alert_relabel_configs in Cortex
- if missing in the alert labels it will be added
Change-Id: I89bcc0672aa663178d02e69bdc941c1fcc63db80
Related-PROD: PRODX-24796
diff --git a/sf_notifier/server.py b/sf_notifier/server.py
index 8077627..3702992 100644
--- a/sf_notifier/server.py
+++ b/sf_notifier/server.py
@@ -56,7 +56,9 @@
try:
alert['labels']['env_id'] = sf_cli.environment
fields, action = alert_fields_and_action(
- alert, add_links=settings.ADD_LINKS)
+ alert,
+ add_links=settings.ADD_LINKS,
+ cluster_id=settings.CLUSTER_ID)
except KeyError as key:
msg = 'Alert misses {} key.'.format(key)
app.logger.error(msg)