alertmanager-sentry-gateway is a webhook gateway for Alertmanager. This gateway receives webhooks from Alertmanager and sends alert information as an event to Sentry.
Go to the releases page, find the version you want, and download the tarball file.
$ docker pull summerwind/alertmanager-sentry-gateway:latest
To build the binary you need to install Go, dep and task.
$ task vendor
$ task build
Sentry's DSN is required to run this gateway.
$ alertmanager-sentry-gateway --dsn ${SENTRY_DSN}
Event body of Sentry can be customized with a template file as follows. The data passed to the template file is an Alert of Alertmanager.
$ vim template.tmpl
{{ .Labels.alertname }} - {{ .Labels.instance }}
{{ .Annotations.description }}
Labels:
{{ range .Labels.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
$ alertmanager-sentry-gateway --dsn ${SENTRY_DSN} --template template.tmpl
To enable Alertmanager to send alerts to this gateway you need to configure a webhook in Alertmanager.
receivers:
- name: team
webhook_configs:
- url: 'http://127.0.0.1:9096'
send_resolved: false