prometheus / prometheus/alertmanager
Alertmanager native integration jira problem
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 8.6k
- Forks
- 2.5k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 61
Description
Hello.
I am configuring Alertmanager native integration with Jira. Before upgrading to version 0.28.0, we were using the jira-ab receiver. We are using Jira Data Center.
- api_url: http://hostname-jira/rest/api/2/
description: '{{ template "jira.default.description" . }}'
fields:
components:
- name: Monitoring
customfield_10001: Auto-created by Alertmanager
http_config:
basic_auth:
password: <pass>
username: jiralert
issue_type: Bug
labels:
- alertmanager
- '{{ .CommonLabels.severity }}'
priority: '{{ .CommonLabels.severity }}'
project: MON
reopen_duration: 1h
reopen_transition: Reopen
send_resolved: true
summary: '{{ template "jira.default.summary" . }}'
name: receiver-jira-dc
route:
- continue: true
group_by:
- alertname
- instance
matchers:
- alertname = "TestJiraAlert"
receiver: receiver-jira-dc
However, when sending a test alert, I receive the following message:
time=2025-03-05T10:02:55.603Z level=WARN source=jira.go:145 msg="Truncated summary" integration=jira group_key="{}/{alertname=\"TestJiraAlert\"}:{alertname=\"TestJiraAlert\", instance=\"<name>:9100\"}" max_runes=255
It seems that the correct issue is not being found, and it tries to use the most recently resolved one. I suspect the issue is related to the template configuration.
{{ define "jira.summary" }}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .GroupLabels.SortedPairs.Values | join "," }}{{ end }}
{{ define "jira.description" }}{{ range .Alerts.Firing }}Labels:
{{ range .Labels.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
Annotations:
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
Source: {{ .GeneratorURL }}
{{ end }}
CommonLabels:
{{ range .CommonLabels.SortedPairs }} - {{ .Name }} = {{ .Value}}
{{ end }}
GroupLabels:
{{ range .GroupLabels.SortedPairs }} - {{ .Name }} = {{ .Value}}
{{ end }}
{{ end }}
I need help. What am I doing wrong?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in jira.go around the logged lines 145 and 245, then compare the native Jira configuration and the supplied jira.summary and jira.description templates. Determine whether the template configuration explains the issue matching and summary behavior; done means documenting the cause or a reproducible fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100