updog

command module
v0.0.0-...-909f31c Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 13 Imported by: 0

README

What's updog?

Well, hopefully your application is 👈😎👈

If not, updog will tell you.

Updog is statuspages companion and best friend. It receives alerts via webhook from prometheus-alertmanager and automatically creates/updates GitHub issues to be displayed as incidents using dombott/statuspage.

updog

Configuration

The following flags and env vars can be used to configure updog.

addr := flag.String("addr", ":8080", "address to listen on")
owner := flag.String("owner", "", "github repo owner")
repo := flag.String("repo", "", "github repo name")
token := os.Getenv("GH_TOKEN")

addr: the address of the webhook. Updog handles requests to /webhook and /healthz.

owner and repo: the owner and repo name that updog operates in.

token: a GitHub PAT. Needs permission on the repo to read and write issues and labels.

How does it work?

Updog generates an issue (title, body, labels) from an alert using its metadata.

It uses the content of the labels updog/title, updog/body and updog/labels to fill the respective field. Multiple labels can be added as a semicolon separated list. The label type/incident is added automatically (to make the incident show up in statuspage). It is recommended to use the alertmanager templating to fill these labels with values from the prometheus metrics.

To identify an issue later, the fingerprint of the alert is added to the title during creation (statuspage will cut off this identifier when displaying the incident). The alertmanager fingerprint is the hash value of all the labels of an alert.

If a firing alert comes from the alertmanager, updog will check if there is already an open issue for the alert by searching for the identifier. If the issue already exists, updog does nothing. If the issue doesn't exist, updog will create the issue (and the labels if necessary).

If a resolved alert comes from the alertmanager, updog will check if there is an open issue for the alert by searching for the identifier. If the issue exists, updog will close it.

How do I use this?

Simply run updog next to your alertmanager and set up a route to send alerts to updogs webhook.

route:
  group_by: ['alertname']
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 3h

  routes:
  - match:
      severity: critical
    receiver: updog

receivers:
- name: updog
  webhook_configs:
  - url: 'http://updog.default.svc.cluster.local:8080/webhook'

Add the labels updog/title, updog/body and updog/labels to your alerts and fill them via alertmanager templating.

Configure updog to use the GitHub repo of your choice and provide a GitHub PAT for auth.

If you want to use statuspage together with updog, configure both to use the same GitHub repo.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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