prometheus-community / jiralert

JIRA integration for Prometheus Alertmanager
Apache License 2.0
338 stars 129 forks source link

Add ability to update in comments (now configurable per receiver) #180

Closed twotired closed 9 months ago

twotired commented 1 year ago

As an alternative, or as an addition to updating the Description, additional Alert updates should go to comments.

The default behavior is to update the JIRA Description when the Alert details change. This makes it difficult if the viewers of the JIRA are researching each failure because it is not obvious which alerts are new or existing. Depending on the Alert expression, old firing details may also be removed.

Additionally, adding too many firing details to the description increases the likelihood of exceeding the 32KB char limit for the JIRA Description.

By optionally sending each update to a Comment, viewers can better keep track of which activity is new, and it will be possible to continue adding firing details without exceeding the Description char limit.

resolves https://github.com/prometheus-community/jiralert/issues/160

twotired commented 1 year ago

@bwplotka @MytkoEnko @cropalato @holger-waschke

Please review this new PR for adding updates in comments with better configurability and additional tests.

holger-waschke commented 1 year ago

That looks good, I will test it in our environment soon.

One idea would be to provide a seperate template for the comments. per example in our case we only want to post the annotations but not the labels as comment.

twotired commented 11 months ago

That looks good, I will test it in our environment soon.

@holger-waschke any problems discovered in testing?

holger-waschke commented 11 months ago

Yes it works just fine.

One issue we faced were too long comments, as we have dozen of static labels. I added some code to cut anything but the annotations, this is were changes occur in our case. But that's not suitable for everyone, you think it's a good idea to implement a template which applies only for comments?

twotired commented 10 months ago

@bwplotka please review... I switched from NullBool to bool*