jiralert

package module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

README

JIRAlert

Build Status Go Report Card 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

Install with Helm
helm install ./charts/jiralert -n {your-namespace}
Install with Binary

Get JIRAlert, either as a [packaged release.yaml](https://github.com/prometheus-community/jiralert/releases) 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") [...]


Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckConfig

func CheckConfig(ctx context.Context, je *config.Config) *config.Config

Verify Config if not exist

func ConfigHandlerFunc

func ConfigHandlerFunc(config *config.Config) func(http.ResponseWriter, *http.Request)

ConfigHandlerFunc is the HTTP handler for the `/config` page. It outputs the configuration marshaled in YAML format.

func HomeHandlerFunc

func HomeHandlerFunc() func(http.ResponseWriter, *http.Request)

HomeHandlerFunc is the HTTP handler for the home page (`/`).

Types

type Jiralert

type Jiralert struct {
	Input       *alertmanager.Data
	Config      *config.Config
	Template    *template.Template
	IsHashLable bool
}

func (Jiralert) NewIssues

func (je Jiralert) NewIssues(ctx context.Context) (string, error)

New Issues a new Jiralert.

type JiralertFunc

type JiralertFunc interface {
	NewIssues(ctx context.Context) (string, error)
	UpdateIssues(ctx context.Context) (string, error)
	CloseIssues(ctx context.Context) (string, error)
}

Directories

Path Synopsis
cmd
pkg
alertmanager
Package alertmanager defines structures and primitives to support Alertmanager's webhook API.
Package alertmanager defines structures and primitives to support Alertmanager's webhook API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL