{"id":27306317,"url":"https://github.com/mikeroll/alertmanager-sentry-gateway","last_synced_at":"2026-08-06T09:00:52.401Z","repository":{"id":56036645,"uuid":"110346355","full_name":"mikeroll/alertmanager-sentry-gateway","owner":"mikeroll","description":"Sentry gateway for Alertmanager","archived":false,"fork":false,"pushed_at":"2020-11-30T09:37:23.000Z","size":3999,"stargazers_count":26,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-07-09T19:27:15.522Z","etag":null,"topics":["alertmanager","golang","prometheus","sentry"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikeroll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-11T13:10:36.000Z","updated_at":"2025-09-09T07:45:01.000Z","dependencies_parsed_at":"2022-08-15T11:50:59.157Z","dependency_job_id":null,"html_url":"https://github.com/mikeroll/alertmanager-sentry-gateway","commit_stats":null,"previous_names":["summerwind/alertmanager-sentry-gateway"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mikeroll/alertmanager-sentry-gateway","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeroll%2Falertmanager-sentry-gateway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeroll%2Falertmanager-sentry-gateway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeroll%2Falertmanager-sentry-gateway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeroll%2Falertmanager-sentry-gateway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeroll","download_url":"https://codeload.github.com/mikeroll/alertmanager-sentry-gateway/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeroll%2Falertmanager-sentry-gateway/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36331988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"ssl_error","status_checked_at":"2026-08-06T04:43:02.660Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alertmanager","golang","prometheus","sentry"],"created_at":"2025-04-12T03:59:25.511Z","updated_at":"2026-08-06T09:00:52.313Z","avatar_url":"https://github.com/mikeroll.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alertmanager-sentry-gateway\n\nalertmanager-sentry-gateway is a webhook gateway for [Alertmanager](https://github.com/prometheus/alertmanager). This gateway receives webhooks from Alertmanager and sends alert information as an event to [Sentry](https://sentry.io).\n\n## Install\n\n### Just want the binary?\n\nGo to the [releases page](https://github.com/mikeroll/alertmanager-sentry-gateway/releases), find the version you want, and download the tarball file.\n\n### Run as container?\n```\n# \u003c= v0.3.0\n$ docker pull summerwind/alertmanager-sentry-gateway:\u003ctag\u003e\n\n# \u003e= v0.4.0\n$ docker pull mikeroll/alertmanager-sentry-gateway:\u003ctag\u003e\n```\n\n### Building binary yourself\n\nTo build the binary you need to install [Go](https://golang.org/), [dep](https://github.com/golang/dep) and [task](https://github.com/go-task/task).\n\n```\n$ task vendor\n$ task build\n```\n\n### Building a docker image yourself\nIf you don't want to deal with go-specific stuff and just want a docker image:\n```\n$ docker build -t \u003ctag\u003e .\n```\n\n\n## Usage\n\nSentry's DSN is required to run this gateway. Optionally, an environment may be specified.\n\n```\n$ alertmanager-sentry-gateway --dsn ${SENTRY_DSN} --environment ${SENTRY_ENVIRONMENT}\n```\n\nIf you prefer configuration via environment variables, exporting `SENTRY_DSN` and `SENTRY_ENVIRONMENT` to the process will have the same effect - you can then omit the cli arguments entirely.\n\n### DSN proxying\nIt is possible to support forwarding events to any Sentry DSN (as opposed to locking the gateway into a single one via `SENTRY_DSN`). To enable such DSN proxying, provide the base url of the target Sentry instance via `--sentry-url`/`SENTRY_URL`. Gateway url can the be specified as follows, similar to a \"real\" DSN:  \n```\n\u003cgateway_scheme\u003e//\u003cproject_secret\u003e@\u003cgateway_host\u003e/\u003cproject_id\u003e\n```\nE.g. given `SENTRY_URL=https://my.hosted.sentry:8000/`, with the gateway running at `http://sentry.gateway:9096/`, the gateway url should be given as `http://a1b2c3d4e5f6@sentry.gateway:9096/42` and the corresponding DSN will be reconstructed as `https://a1b2c3d4e5f6@my.hosted.sentry:8000/42`.\n\n### Sentry environment\nDefault environment is taken from argument `environment` or from env variable `SENTRY_ENVIRONMENT`.  \nIf you are using DSN proxying, then there is also a way to specify environment via url path:\n`http://a1b2c3d4e5f6@sentry.gateway:9096/42/my_environment`\nReplace `my_environment` with any other valid string, and gateway will pass that environment with event.\n\n### Sentry environment from alert label\nThere is also a third way to specify sentry environment, which would come from alert label itself. You can specify alert label via command line argument: `environment-label` or via environment variable: `SENTRY_ENVIRONMENT_LABEL`.  \nFor example:\nYou have alert with label `my-label` which has value `my-sentry-environment`. \nThen you specify it like so: `--environment-label=my-label` and if alert coming in has this label, it will set sentry environment for that alert equal to the value of that label.  \nThis overwrites any existing sentry environment which was set via URL or `--environment` argument. So that allows to ingest alerts that might not have that label, in that case they will use sentry environment from previous methods.\n\n\n### Event body\nEvent body of Sentry can be customized with a template file as follows. The data passed to the template file is an [Alert](https://godoc.org/github.com/prometheus/alertmanager/template#Alert) of Alertmanager.\n\n```\n$ vim template.tmpl\n```\n```\n{{ .Labels.alertname }} - {{ .Labels.instance }}\n{{ .Annotations.description }}\n\nLabels:\n{{ range .Labels.SortedPairs }} - {{ .Name }} = {{ .Value }}\n{{ end }}\n```\n```\n$ alertmanager-sentry-gateway --dsn ${SENTRY_DSN} --template template.tmpl\n```\n\nAlternatively, provide a `SENTRY_GATEWAY_TEMPLATE` variable with the template string:\n```\n$ export SENTRY_GATEWAY_TEMPLATE=\"{{ .Labels.alertname }} - {{ .Labels.instance }}\"\n$ alertmanager-sentry-gateway\n```\n\n\n### Event fingerprinting\nAn Sentry event's fingerprint defines the properties of that event that shall be used to tell if multiple events belong to the same group. The fingerprints of outgoing events may be controlled via `--fingerprint-templates`/`SENTRY_GATEWAY_FINGERPRINT_TEMPLATES`, which are used similiarly to the message template. For example:\n```\n$ alertmanager-sentry-gateway --fingerprint-templates \"{{ .Labels.instance }}\" \"{{ .Labels.alertname }}\"\n```\nwill cause events with the same `alertname` and `instance` labels to be grouped into a single issue.\nIf `--fingerprint-templates` is not supplied, Sentry's default algorithm is used.\n\n\n## Alertmanager Configuration\n\nTo enable Alertmanager to send alerts to this gateway you need to configure a webhook in Alertmanager.\n\n```\nreceivers:\n- name: team\n  webhook_configs:\n  - url: 'http://127.0.0.1:9096'\n    send_resolved: false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeroll%2Falertmanager-sentry-gateway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeroll%2Falertmanager-sentry-gateway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeroll%2Falertmanager-sentry-gateway/lists"}