All Projects → m-lab → alertmanager-github-receiver

m-lab / alertmanager-github-receiver

Licence: Apache-2.0 License
Prometheus Alertmanager webhook receiver that creates GitHub issues from alerts

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to alertmanager-github-receiver

flask prometheus metrics
Prometheus Metrics for Flask Web App
Stars: ✭ 17 (-39.29%)
Mutual labels:  prometheus
emq exporter
Simple server that scrapes EMQ metrics and exporters them via HTTP for Prometheus consumption
Stars: ✭ 31 (+10.71%)
Mutual labels:  prometheus
geoip-exporter
GeoIP exporter for Prometheus
Stars: ✭ 27 (-3.57%)
Mutual labels:  prometheus
prometheus-bigquery-exporter
An exporter for converting BigQuery results into Prometheus metrics
Stars: ✭ 27 (-3.57%)
Mutual labels:  prometheus
metrics-server-exporter
Metrics Server Exporter
Stars: ✭ 58 (+107.14%)
Mutual labels:  prometheus
Cassibility
This is a set of Grafana dashboards for monitoring Cassandra together with a prometheus datasource.
Stars: ✭ 59 (+110.71%)
Mutual labels:  prometheus
elasticsearch exporter
Elasticsearch stats exporter for Prometheus
Stars: ✭ 1,462 (+5121.43%)
Mutual labels:  prometheus
request log analyzer
Extract some performance metrics from the request.log of a CQ/AEM instance. It can be used as an alternative to or in addition to `rlog.jar`.
Stars: ✭ 27 (-3.57%)
Mutual labels:  prometheus
chia-monitor
🍃 A comprehensive monitoring and alerting solution for the status of your Chia farmer and harvesters.
Stars: ✭ 131 (+367.86%)
Mutual labels:  prometheus
gobgp exporter
Prometheus Exporter for GoBGP
Stars: ✭ 15 (-46.43%)
Mutual labels:  prometheus
elastic-adapter
Elastic remote storage adapter for prometheus.
Stars: ✭ 17 (-39.29%)
Mutual labels:  prometheus
gluster exporter
Gluster Exporter for Prometheus
Stars: ✭ 70 (+150%)
Mutual labels:  prometheus
centos-script
🎉centos下工具安装脚本,包含基础环境配置,Gitlab、Docker、LDAP、MongoDB、MySQL、RabbitMQ、Supervisor、Node、Python、zsh、rar、zabbix、k8s、prometheus、grafana等🎉
Stars: ✭ 121 (+332.14%)
Mutual labels:  prometheus
prometheus-anomaly-detector-legacy
A simple application to collect data from a prometheus host and train a model on it
Stars: ✭ 21 (-25%)
Mutual labels:  prometheus
docker-jmx-prometheus-exporter
Dockerized jmx-exporter for prometheus
Stars: ✭ 24 (-14.29%)
Mutual labels:  prometheus
loki exporter
Prometheus exporter to collect metrics and run queries against the Grafana Loki API.
Stars: ✭ 28 (+0%)
Mutual labels:  prometheus
druid-prometheus-exporter
Service to collect Apache Druid metrics and export them to Prometheus
Stars: ✭ 14 (-50%)
Mutual labels:  prometheus
prometheus client php
Prometheus instrumentation library for PHP applications
Stars: ✭ 137 (+389.29%)
Mutual labels:  prometheus
sa-prometheus-exporters
Collection of the preselected prometheus exporters to be installed on a target nodes
Stars: ✭ 17 (-39.29%)
Mutual labels:  prometheus
firehose
Firehose is an extensible, no-code, and cloud-native service to load real-time streaming data from Kafka to data stores, data lakes, and analytical storage systems.
Stars: ✭ 213 (+660.71%)
Mutual labels:  prometheus

alertmanager-github-receiver

Version Build Status Coverage Status GoDoc | Go Report Card

Not all alerts are an emergency. But, we want to track every one because alerts are always an actual problem. Either:

  • an actual problem in the monitored system
  • an actual problem in processes around the monitored system
  • an actual problem with the alert itself

The alertmanager github receiver creates GitHub issues using Alertmanager webhook notifications.

Build

make docker DOCKER_TAG=repo/imageName

This will build the binary and push it to repo/imageName.

Setup

Create GitHub access token

The github receiver uses user access tokens to create issues in an existing repository.

Generate a new access token:

Because this access token has permission to create issues and operate on repositories the access token user can access, protect the access token as you would a password.

Start GitHub Receiver

To start the github receiver locally:

docker run -it -p 9393:9393 measurementlab/alertmanager-github-receiver:latest
        -authtoken=$(GITHUB_AUTH_TOKEN) -org=<org> -repo=<repo>

Note: both the org and repo must already exist.

Configure Alertmanager Webhook Plugin

The Prometheus Alertmanager supports third-party notification mechanisms using the Alertmanager Webhook API.

Add a receiver definition to the alertmanager configuration.

- name: 'github-receiver-issues'
  webhook_configs:
  - url: 'http://localhost:9393/v1/receiver'

To publish a test notification by hand, try:

msg='{
  "version": "4",
  "groupKey": "fakegroupkey",
  "status": "firing",
  "receiver": "http://localhost:9393/v1/receiver",
  "groupLabels": {"alertname": "FoobarIsBroken"},
  "externalURL": "http://localhost:9093",
  "alerts": [
    {
      "labels": {"thing": "value"},
      "annotations": {"hint": "how to fix foobar"},
      "status": "firing",
      "startsAt": "2018-06-12T01:00:00Z",
      "endsAt": "2018-06-14T01:00:00Z"
    }
  ]
}'
curl -XPOST --data-binary "${msg}" http://localhost:9393/v1/receiver

Configuration

Alertmanager & Github Receiver

The Alertmanager configuration controls what labels are present on alerts delivered to the github-receiver. The github-receiver configuration must be compatible with these settings to work effectively.

For example, it is common for the Alertmanager to use alert routes that group_by: ['alertname']. See: https://github.com/prometheus/alertmanager#example

And, the github-receiver's default "title template" is {{ .Data.GroupLabels.alertname }}, which depends on an alertname group label.

If an alert does not include this label, the template will evaluate to <no value>. To prevent this, ensure that the github-receiver title template uses labels available in an Alertmanager Message.

Auto close

If -enable-auto-close is specified, the program will close each issue as its corresponding alert is resolved. It searches for matching issues by filtering open issues on the value of -alertlabel and then matching issue titles. The issue title template can be overridden using -title-template-file for greater (or lesser) specificity. The default template is {{ .Data.GroupLabels.alertname }}, which sets the issue title to the alert name. The template is passed a Message as its argument.

Repository

If the alert includes a repo label, issues will be created in that repository, under the GitHub organization specified by -org. If no repo label is present, issues will be created in the repository specified by the -repo option.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].