diff --git a/matrix_alertbot/alertmanager.py b/matrix_alertbot/alertmanager.py index 2d00366..b8754d0 100644 --- a/matrix_alertbot/alertmanager.py +++ b/matrix_alertbot/alertmanager.py @@ -71,6 +71,8 @@ class AlertmanagerClient: ) -> str: alert = await self.get_alert(fingerprint) + logger.debug(f"Creating silence for alert with fingerprint {fingerprint}") + silence_matchers = [ {"name": label, "value": value, "isRegex": False, "isEqual": True} for label, value in alert["labels"].items() @@ -101,7 +103,9 @@ class AlertmanagerClient: f"Cannot find silence for alert with fingerprint {fingerprint} in cache." ) - logger.debug(f"Updating silence with ID {silence_id}") + logger.debug( + f"Updating silence with ID {silence_id} for alert with fingerprint {fingerprint}" + ) if duration_seconds is None: if expire_time is not None: @@ -115,7 +119,7 @@ class AlertmanagerClient: silence_matchers = silence["matchers"] return await self._create_or_update_silence( - fingerprint, silence_matchers, user, duration_seconds + fingerprint, silence_matchers, user, duration_seconds, silence_id ) async def create_or_update_silence(