Skip to content

Commit

Permalink
fix: Mailer: more debug messages (#368)
Browse files Browse the repository at this point in the history
This will help to detect issues
  • Loading branch information
jrevillard authored Oct 18, 2021
1 parent e743cdd commit 106e3e2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions integrations/mailer/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,23 @@ def on_message(self, body, message):
LOG.warn(e)
return

LOG.debug('Alert received from the queue (id: %s)', alertid)
if alert.repeat:
LOG.debug('Ignored alert %s: repeat state', alertid)
message.ack()
return

if alert.status not in ['open', 'closed']:
LOG.debug('Ignored alert %s: not in open or closed state', alertid)
message.ack()
return

if (
alert.severity not in sevs and
alert.previous_severity not in sevs
):
LOG.debug('Ignored alert %s: severity or previous_severity does not matche the severities configuration (%s)',
alertid, sevs)
message.ack()
return

Expand Down

0 comments on commit 106e3e2

Please sign in to comment.