Skip to content

Add Jira notifier.#601

Closed
devnev wants to merge 1 commit intoprometheus:masterfrom
improbable-io:master
Closed

Add Jira notifier.#601
devnev wants to merge 1 commit intoprometheus:masterfrom
improbable-io:master

Conversation

@devnev
Copy link
Contributor

@devnev devnev commented Jan 11, 2017

Add a notifier that can open tickets in Jira. This version does not support resolving alerts as mapping that onto ticket states is a little more complex.

This has been tested by running alertmanager with config for a cloud jira setup and manually triggering an alert.

@beorn7

@brian-brazil
Copy link
Contributor

Jira is so customisable that I'm not sure we can sanely offer a notifier for it, as everyone is likely to need custom code for their particular team's setup.

For example there might be additional mandatory fields in a given organisation that this doesn't handle.

I'd suggest a look at https://github.com/fabxc/jiralerts

@devnev
Copy link
Contributor Author

devnev commented Jan 11, 2017

For example there might be additional mandatory fields in a given organisation that this doesn't handle.

The Fields field of the config allows arbitrary additional fields to be set on alerts.

@devnev
Copy link
Contributor Author

devnev commented Jan 11, 2017

likely to need custom code for their particular team's setup

there's a base set of required fields, and everything else can be set in the issue request, so can have an equivalent piece of alertmanager config. the choice of transition can be explicitly configurable (rather than the magic in https://github.com/fabxc/jiralerts) which should also avoid custom user code.

@beorn7
Copy link
Member

beorn7 commented Jan 11, 2017

@fabxc got quite deep inte the JIRA thing when he wrote https://github.com/fabxc/jiralerts . (I still remember his curses.) He should be able to spot if this PR ingeniously solves all the problems or, alternatively, where it fails to do so.

return false, err
}

req, err := http.NewRequest("POST", "https://jira.atlassian.com/rest/api/2/issue", bytes.NewBuffer(body))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will create a new JIRA every group_interval:
https://prometheus.io/docs/alerting/configuration/#route-route

I'm guessing it'll also create a new JIRA for every resolved alert notification.

Copy link
Contributor

@mattbostock mattbostock Jan 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: VSendResolved is set to false, so it won't create JIRAs for resolved alerts.

@bcwilsondotcom
Copy link

+1 Would like to see this merged.

@fabxc
Copy link
Contributor

fabxc commented Apr 21, 2017

The main issue with it was indeed the heavy customisability of JIRA, in particular for issue transitions. See here, how jiralerts attempts to do an best effort thing based on common possible transitions.

Also consider what happens with flapping alerts. If the same alert goes on and off 10 times in a row, do you really want 10 tickets? jiralerts puts a key in the description that is used for deduplication.

Overall it is still unlikely to do what works for everyone's JIRA workflows.
I think it is really worth investigating #701

@devnev
Copy link
Contributor Author

devnev commented Apr 22, 2017

The main issue with it was indeed the heavy customisability of JIRA, in particular for issue transitions. See here, how jiralerts attempts to do an best effort thing based on common possible transitions.

This is solved by simply not supporting closing or reopening tickets. If an alert fires, it is worth investigating, regardless of whether the condition stops being active, so the ticket should not be closed automatically. If a ticket has been closed, it has been declared as solved, so a new alert should file a new ticket. If a ticket has been closed but the alert is still firing, the issue will be bumped by filing a new ticket after repeat_interval. All that's left is filing new tickets, which does not seem to be workflow-dependent.

Also consider what happens with flapping alerts. If the same alert goes on and off 10 times in a row, do you really want 10 tickets? jiralerts puts a key in the description that is used for deduplication.

Would it make sense to add a group_retain_period or similar in alertmanager to handle flaps instead of having to do this in each plugin?

hh pushed a commit to ii/alertmanager that referenced this pull request Jun 19, 2017
Add `go get` and source directory requirements to the build
instructions.
@harshad007
Copy link

Hello,
I have one field in jira called action_url under description, but when jira ticket is created, it is unable to pick that action_url part
I am missing something here, need help...

alin-amana added a commit to alin-amana/alertmanager that referenced this pull request Sep 29, 2017
@alin-amana alin-amana mentioned this pull request Sep 29, 2017
@alin-amana
Copy link
Contributor

FYI, I've just put together an initial release of JIRAlert, a webhook receiver based on this PR and the comments it received, plus some ideas (and naming inspiration) from jiralerts. One issue is created (or reopened) per distinct group key and never closed (a human is expected to be in the loop for that part).

Even though it is a separate binary it provides the same templating support as Alertmanager (a tiny bit of borrowed code, again) and it keeps the Fields field introduced by this PR, so created issues can be highly customized.

If any functionality/behavior you might need is missing, feel free to implement them. Or ask nicely, who knows? :o)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants