Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alertmanager native integration jira problem #4293

Open
OlegF31 opened this issue Mar 5, 2025 · 0 comments
Open

Alertmanager native integration jira problem #4293

OlegF31 opened this issue Mar 5, 2025 · 0 comments

Comments

@OlegF31
Copy link

OlegF31 commented Mar 5, 2025

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?

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

No branches or pull requests

2 participants