diff --git a/src/robusta/core/sinks/webhook/webhook_sink.py b/src/robusta/core/sinks/webhook/webhook_sink.py index 44dcf3ae6..9ef20b1c2 100644 --- a/src/robusta/core/sinks/webhook/webhook_sink.py +++ b/src/robusta/core/sinks/webhook/webhook_sink.py @@ -93,12 +93,19 @@ def __write_json(self, finding: Finding, platform_enabled: bool): else: break if self.slack_webhook: + labels = message.get('subject', {}).get('labels') + if labels: + labels_as_text = ", ".join(f"{k}: {v}" for k, v in labels.items()) + else: + labels_as_text = None message = { "text": f"*Title:* {message['title']}\n" f"*Description:* {message['description']}\n" f"*Failure:* {message['failure']}\n" f"*Aggregation Key:* {message['aggregation_key']}\n" + f"*labels*: {labels_as_text}\n" } + logging.info(f"message after is {json.dumps(message)}") try: r = requests.post(self.url, json=message, headers=self.headers) r.raise_for_status()