• Stars
    star
    333
  • Rank 126,599 (Top 3 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JIRA integration for Prometheus Alertmanager

JIRAlert

Build Status Go Report Card GoDoc Slack Prometheus Alertmanager webhook receiver for JIRA.

Overview

JIRAlert implements Alertmanager's webhook HTTP API and connects to one or more JIRA instances to create highly configurable JIRA issues. One issue is created per distinct group key โ€” as defined by the group_by parameter of Alertmanager's route configuration section โ€” but not closed when the alert is resolved. The expectation is that a human will look at the issue, take any necessary action, then close it. If no human interaction is necessary then it should probably not alert in the first place. This behavior however can be modified by setting auto_resolve section, which will resolve the jira issue with required state.

If a corresponding JIRA issue already exists but is resolved, it is reopened. A JIRA transition must exist between the resolved state and the reopened state โ€” as defined by reopen_state โ€” or reopening will fail. Optionally a "won't fix" resolution โ€” defined by wont_fix_resolution โ€” may be defined: a JIRA issue with this resolution will not be reopened by JIRAlert.

Usage

Get JIRAlert, either as a packaged release or build it yourself:

$ go get github.com/prometheus-community/jiralert/cmd/jiralert

then run it from the command line:

$ jiralert

Use the -help flag to get help information.

$ jiralert -help
Usage of jiralert:
  -config string
      The JIRAlert configuration file (default "config/jiralert.yml")
  -listen-address string
      The address to listen on for HTTP requests. (default ":9097")
  [...]

Testing

JIRAlert expects a JSON object from Alertmanager. The format of this JSON is described in the Alertmanager documentation or, alternatively, in the Alertmanager GoDoc.

To quickly test if JIRAlert is working you can run:

$ curl -H "Content-type: application/json" -X POST \
  -d '{"receiver": "jira-ab", "status": "firing", "alerts": [{"status": "firing", "labels": {"alertname": "TestAlert", "key": "value"} }], "groupLabels": {"alertname": "TestAlert"}}' \
  http://localhost:9097/alert

Configuration

The configuration file is essentially a list of receivers matching 1-to-1 all Alertmanager receivers using JIRAlert; plus defaults (in the form of a partially defined receiver); and a pointer to the template file.

Each receiver must have a unique name (matching the Alertmanager receiver name), JIRA API access fields (URL, username and password), a handful of required issue fields (such as the JIRA project and issue summary), some optional issue fields (e.g. priority) and a fields map for other (standard or custom) JIRA fields. Most of these may use Go templating to generate the actual field values based on the contents of the Alertmanager notification. The exact same data structures and functions as those defined in the Alertmanager template reference are available in JIRAlert.

Alertmanager configuration

To enable Alertmanager to talk to JIRAlert you need to configure a webhook in Alertmanager. You can do that by adding a webhook receiver to your Alertmanager configuration.

receivers:
- name: 'jira-ab'
  webhook_configs:
  - url: 'http://localhost:9097/alert'
    # JIRAlert ignores resolved alerts, avoid unnecessary noise
    send_resolved: false

Profiling

JIRAlert imports net/http/pprof to expose runtime profiling data on the /debug/pprof endpoint. For example, to use the pprof tool to look at a 30-second CPU profile:

go tool pprof http://localhost:9097/debug/pprof/profile

To enable mutex and block profiling (i.e. /debug/pprof/mutex and /debug/pprof/block) run JIRAlert with the DEBUG environment variable set:

env DEBUG=1 ./jiralert

Community

Jiralert is an open source project and we welcome new contributors and members of the community. Here are ways to get in touch with the community:

License

JIRAlert is licensed under the MIT License.

Copyright (c) 2017, Alin Sinpalean

More Repositories

1

helm-charts

Prometheus community Helm charts
Mustache
4,981
star
2

windows_exporter

Prometheus exporter for Windows machines
Go
2,905
star
3

postgres_exporter

A PostgreSQL metric exporter for Prometheus
Go
2,720
star
4

elasticsearch_exporter

Elasticsearch stats exporter for Prometheus
Go
1,925
star
5

PushProx

Proxy to allow Prometheus to scrape through NAT etc.
Go
715
star
6

json_exporter

A prometheus exporter which scrapes remote JSON by JSONPath
Go
631
star
7

node-exporter-textfile-collector-scripts

Scripts for node-exporter's textfile collector
Python
490
star
8

ipmi_exporter

Remote IPMI exporter for Prometheus
Go
459
star
9

avalanche

Prometheus/OpenMetrics endpoint series generator for load testing.
Go
393
star
10

ansible

Ansible Collection for Prometheus
Python
357
star
11

pro-bing

A library for creating continuous probers
Go
317
star
12

bind_exporter

Prometheus exporter for BIND
Go
299
star
13

smartctl_exporter

Export smartctl statistics to prometheus
Go
289
star
14

systemd_exporter

Exporter for systemd unit metrics
Go
283
star
15

prom-label-proxy

A proxy that enforces a given label in a given PromQL query.
Go
262
star
16

stackdriver_exporter

Google Stackdriver Prometheus exporter
Go
254
star
17

promql-langserver

PromQL language server
Go
176
star
18

prometheus-playground

Turnkey sandbox projects demonstrating a wide variety of Prometheus use cases
Go
164
star
19

pgbouncer_exporter

Prometheus exporter for PgBouncer
Go
138
star
20

ecs_exporter

Prometheus exporter for Amazon Elastic Container Service (ECS)
Go
78
star
21

vscode-promql

This is supposed to become a PromQL extension for vs code.
TypeScript
52
star
22

monaco-promql

PromQL support for the Monaco code editor
TypeScript
31
star
23

community

Prometheus & The Ecosystem Community Meeting Information
20
star
24

prometheus-community

13
star
25

snmp

Tools and configurations for translating SNMP into Prometheus
11
star
26

kitefactory

Makefile
3
star
27

sublimelsp-promql

PromQL support for Sublime LSP plugin, using promql-langserver
Python
2
star