{"id":21397579,"url":"https://github.com/multani/alertmanager-webhook-logger","last_synced_at":"2025-07-13T20:32:23.885Z","repository":{"id":52078164,"uuid":"518500714","full_name":"multani/alertmanager-webhook-logger","owner":"multani","description":"An Alertmanager webhook receiver implementation that logs alerts to stdout","archived":false,"fork":false,"pushed_at":"2024-08-14T06:53:49.000Z","size":105,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-14T08:02:03.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/multani.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-27T14:52:53.000Z","updated_at":"2024-08-14T06:53:52.000Z","dependencies_parsed_at":"2023-02-17T16:45:36.429Z","dependency_job_id":"1154943d-3aab-404f-adb5-5bdc9ddf0621","html_url":"https://github.com/multani/alertmanager-webhook-logger","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multani%2Falertmanager-webhook-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multani%2Falertmanager-webhook-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multani%2Falertmanager-webhook-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multani%2Falertmanager-webhook-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multani","download_url":"https://codeload.github.com/multani/alertmanager-webhook-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225916984,"owners_count":17544825,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-22T14:43:37.627Z","updated_at":"2024-11-22T14:43:38.457Z","avatar_url":"https://github.com/multani.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alertmanager webhook logger\n\nThis is a simple [webhook receiver](https://prometheus.io/docs/alerting/latest/configuration/#webhook_config)\nfor [Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/),\nthat logs the alerts it receives as properly formatted JSON documents on stdout.\n\nThe goal of the receiver is to keep a trace of all the alerts that were\ngenerated by Alertmanager, for example to:\n\n* Get an history of all the alerts generated in your logging system and see when\n  alerts were triggered and when they were resolved.\n* Create statistics using your favorite logging system to see which alerts come\n  up the most, with which parameters.\n* Help to create Alertmanager templates, by showing the actual content and\n  structure of the alerts sent.\n\nIt is available as [a Docker image](https://github.com/multani/alertmanager-webhook-logger/pkgs/container/alertmanager-webhook-logger):\n\n```\ndocker pull ghcr.io/multani/alertmanager-webhook-logger\n```\n\n\n## Usage\n\n* Run the webhook logger somewhere where it can be reached by Alertmanager.\n* Add it as a new receiver to Alertmanager in its configuration:\n\n  ```yaml\n  route:\n    receiver: webhook-logger # send all alerts to the webhook-logger\n\n    group_by:\n      - alertname\n\n  receivers:\n    - name: webhook-logger\n      webhook_configs:\n      - url: http://webhook-logger:8000/alerts\n        send_resolved: true\n        max_alerts: 0 # 0=all alerts\n  ```\n\n* Alerts sent by Alertmanager should appear on the webhook logger standart\n  output.\n\n\n## Output format\n\n* The content of the `alerts` field is the content sent by Alertmanager\n* The log level of the overall log message will be:\n  * `info`: the alerts are `resolved`\n  * `warn`: the alerts are `firing`\n  * `error`: something is wrong with the webhook logger itself\n* The timestamp of the log message is when the webhook logger receives and\n  prints the message.\n\n```json\n{\n  \"level\": \"warn\",\n  \"timestamp\": \"2022-07-27T15:54:18.487Z\",\n  \"caller\": \"app/main.go:118\",\n  \"message\": \"Alerts received\",\n  \"alerts\": {\n    \"receiver\": \"webhook\",\n    \"status\": \"firing\",\n    \"alerts\": [\n      {\n        \"status\": \"firing\",\n        \"labels\": {\n          \"alertname\": \"Test1\",\n          \"branch\": \"HEAD\",\n          \"goversion\": \"go1.18.4\",\n          \"instance\": \"127.0.0.1:29591\",\n          \"job\": \"prometheus\",\n          \"revision\": \"b41e0750abf5cc18d8233161560731de05199330\",\n          \"severity\": \"critical\",\n          \"version\": \"2.37.0\"\n        },\n        \"annotations\": {\n          \"summary\": \"Something bad happened\"\n        },\n        \"startsAt\": \"2022-07-27T09:09:25.147Z\",\n        \"endsAt\": \"0001-01-01T00:00:00Z\",\n        \"generatorURL\": \"http://localhost:9090/graph?g0.expr=prometheus_build_info+%3E+0\u0026g0.tab=1\",\n        \"fingerprint\": \"a6f5e9850a5c3760\"\n      }\n    ],\n    \"groupLabels\": {\n      \"alertname\": \"Test1\"\n    },\n    \"commonLabels\": {\n      \"alertname\": \"Test1\",\n      \"branch\": \"HEAD\",\n      \"goversion\": \"go1.18.4\",\n      \"job\": \"prometheus\",\n      \"revision\": \"b41e0750abf5cc18d8233161560731de05199330\",\n      \"severity\": \"critical\",\n      \"version\": \"2.37.0\"\n    },\n    \"commonAnnotations\": {\n      \"summary\": \"Something bad happened\"\n    },\n    \"externalURL\": \"http://localhost:9093\"\n  }\n}\n```\n\n## Deployment \u0026 security\n\n* You can run multiple instances of the webhook logger.\n\n  Alertmanager is supposed to do the de-duplication on its side, and even if\n  different instances of the webhook logger receive the alerts, looking at all\n  the logs of all the webhook logger should give you an overview of the alerting\n  status of your system.\n\n* Don't send secrets into the alerts.\n\n  This is not specific to this Alertmanager receiver, but it will **not** try to\n  conceal any information from your alerts. Any sensitive information part of\n  the content of the alerts themselves will be displayed as it was sent by\n  Alertmanager.\n\n\n## Similar projects\n\nThis project was influenced by [TomTom's own\nalertmanager-webhook-logger](https://github.com/tomtom-international/alertmanager-webhook-logger),\nbut follows a different approach, by trying to stick closer to the original\npayload sent by Alertmanager.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultani%2Falertmanager-webhook-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultani%2Falertmanager-webhook-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultani%2Falertmanager-webhook-logger/lists"}