alertmanager
alertmanager copied to clipboard
jira integration
This PR track the Atlassian JIRA integration into Alertmanger.
See: #3577
Replaces: https://github.com/prometheus-community/jiralert
What I test:
- Jira Cloud only
- Create issues
- Auto-Close issue with
resolve_transition
- Reopen issue with
reopen_transition
- Reopen duration
- Custom Fields
-
api_token_file
Can this integration cover another of jiralert issue - is custom field for alert hash? https://github.com/prometheus-community/jiralert/issues/164
Current code search hash in hardcoded place - in labels
jql.WriteString(fmt.Sprintf(`project = "%s" and
labels=%q order by status ASC,
resolutiondate DESC`, n.conf.Project, key.Hash()))
Thanks
Sure. After merge. Everyone is invited to improve.
I would not like to add more feature here. Even I understand you request.
The current PR covery already a lot of cases to test. Adding more new features results into more testing. I would prefer to add new features in separate PRs.
Is this implementation only for Jira Cloud or can I still use the on-premise API with a PAT Authentication?
Hi @holger-waschke
I'm not able to test on-premise. But you can enter an Server API Path to an on premise instance and the authentication is still auth basic which should work on on-premise, too.
The integration does not use any cloud specific features. If https://github.com/prometheus-community/jiralert works on-premise, this integration should work, too.
I remember that Issue handling, the Jira Software Server API v2 and Cloud API v2 is the same.
- https://docs.atlassian.com/software/jira/docs/api/REST/9.11.0/#api/2/issue
- https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-post
But please keep in mind that this integration will always have best-effort since most users are not able to setup a on premise instance.
Thanks for starting this! I haven't looked yet in details into the notifier but I suppose that it's almost a 1:1 copy from the original project?
No. while jiralert uses a unofficial outdated REST SDK for JIRA, I used the standard http client to setup the few http calls.
@simonpasquier I tested the PR after review and code changes again.
@simonpasquier could you please take a look here? Thanks you.
@simonpasquier
I would kindly ask, if this can be pushed forward after the next release of Alertmanager. I understand, the Release Candidate für 0.27 has an higher priority to fix issues here.
It would finally deprecate the jiralert project (which also lacks for ARM64 support)
i´ve tested the PR with our Jira Cloud Setup and everything looks good so far. Would be really interested in using this, is there an update @simonpasquier?
Showing some additional support here! The tests I ran all look good and I can't wait to get the official release.
I fixed all the pipeline issues now
@simonpasquier thanks for taking an other look here.
Since I open the PR 7 months ago, I learned bit more about go. In conclusion, I added some units tests and I was able to identity some bugs.
Sadly, adding the units tests here requires additional review cycles.
I will continue some integrations tests and once I'm done, I will re-request an review.
I have tested the priority template together with inhibit_rules
which works really great together.
inhibit_rules:
- equal:
- namespace
- alertname
source_matchers:
- severity = critical
target_matchers:
- severity =~ warning|info
- equal:
- namespace
- alertname
source_matchers:
- severity = warning
target_matchers:
- severity = info
Manual testing against Jira Atlassian Cloud works fine.
In conclusion, we have 2 open topic:
-
fields
vscustom_fields
inside jira_config -
github.com/trivago/tgo
for cast nested map frommap[any]any
tomap[string]any
The code looks good to me. Unfortunately, I cannot test in my setup, because I have a problem with the field Labels. I'll way the code be merged to include https://github.com/prometheus-community/jiralert/
I‘m open to extend the feature set after this PR got merged.
Background: it seems like AM has some review capacity issues and increase the scope involves an additional review each time. The current scope is well tested (including manual test against prod systems).
Yes, I would like to see this merged so we can iterate on additional featres.
Thanks for all the reviews.
- I had some issues with jsoniter (as replacement for tcontainer), but I struggle here. Tests are failing with jsoniter.
- I have implement a truncate for jira description (ref https://github.com/prometheus-community/jiralert/pull/165) - also experienced this once already.
- The notify context will be passed to all API calls.
- I merged group_labels and static_labels as suggested by @simonpasquier
Hi all, after 2 approvals. how we should proceed?
Ping @gotjosh @simonpasquier