{"id":18445784,"url":"https://github.com/voronenko/errbot-prometheus-alertmanager","last_synced_at":"2025-06-19T21:33:54.449Z","repository":{"id":145345352,"uuid":"172394692","full_name":"Voronenko/errbot-prometheus-alertmanager","owner":"Voronenko","description":"Opinionated errbot plugin for Prometheus Alert Manager.  Suitable for use with https://github.com/softasap/sa-prometheus-alertmanager, https://github.com/softasap/sa-chatops-errbot   as well as with any custom installation.","archived":false,"fork":false,"pushed_at":"2019-03-02T22:12:52.000Z","size":203,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T05:38:27.356Z","etag":null,"topics":["alertmanager","cichosza","errbot","prometheus"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/Voronenko.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":"2019-02-24T21:53:04.000Z","updated_at":"2023-06-22T09:20:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"d7c4e008-3056-4e66-9fc4-1dddad8d7846","html_url":"https://github.com/Voronenko/errbot-prometheus-alertmanager","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Voronenko/errbot-prometheus-alertmanager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ferrbot-prometheus-alertmanager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ferrbot-prometheus-alertmanager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ferrbot-prometheus-alertmanager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ferrbot-prometheus-alertmanager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Voronenko","download_url":"https://codeload.github.com/Voronenko/errbot-prometheus-alertmanager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Voronenko%2Ferrbot-prometheus-alertmanager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260835865,"owners_count":23070362,"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":["alertmanager","cichosza","errbot","prometheus"],"created_at":"2024-11-06T07:07:21.223Z","updated_at":"2025-06-19T21:33:49.437Z","avatar_url":"https://github.com/Voronenko.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Prometheus Alert Manager plugin for Errbot\n==========================================\n\nMember of `sa-cichosza` family\n\nChatops features for Prometheus Alert Manager\n---------------------------------------------\n\nThis plugin allows you to work with prometheus alerts for your team in a Slack channel.\n More information about Errbot \u003chttp://errbot.io\u003e.\n\nQuickstart\n----------\n\nFirst you need to install Errbot, you can follow this documentation http://errbot.io/en/latest/user_guide/setup.html.\nErrbot server can be installed with https://github.com/softasap/sa-chatops-errbot ansible role or manually\n\nThen you'll need to install this plugin on your Errbot instance doing \n```\n!repos install https://github.com/Voronenko/errbot-prometheus-alertmanager\n```\n, you can do that by talking to your bot locally with `errbot -T`. \n\nInitially, you need also to let bot know how to connect to your prometheus alertmanager instance,\nproviding alert manager address and timezone for time values.\n\n```\n\n!plugin config SaAmtool {'server_address': 'http://10.9.0.138:9093/api/v2', 'time_zone': 'Europe/Kiev'}\n```\n\nOnce everything is setup, you can connect your bot to your Slack channel following this documentation http://errbot.io/en/latest/user_guide/configuration/slack.html.\n\nBot commands\n------------\n## Endpoint status !amtool status\n\nWith `!amtool status` you can check, if alert manager responds\n\n![!amtool status](docs/amtool_status.jpg \"!amtool status\")\n\n\n## Quering alerts !amtool alert query\n\nUsing the `!amtool alert query` command, you can list all alerts that have been send \nto Alertmanager:\n\n```\n!amtool alert query -\n\nAlertname     Starts At                Summary\nEndpointDown  2018-04-03 08:48:47 UTC  Endpoint http://localhost:8080 down\n\n```\n\nNote: use `-` to indicate absence of specific filter criteria.\n\nYou can also filter alerts by their labels using the appropriate matcher. \nA matcher contains the label name, the appropriate operation, which can be = \nfor full matching and =~ for partial matching, and the label's value.\n\nIf you want to list all alerts that have a critical severity label attached, \nuse the severity=critical matcher in the alert query command:\n\n```\n!amtool alert query severity=critical\n```\nLike before, the output contains the alert's name, the time of alert's first occurrence and the alert's summary.\n\nOutput\n```\nAlertname     Starts At                Summary\nEndpointDown  2018-04-03 08:48:47 UTC  Endpoint http://localhost:8080 down\n```\n\n![!amtool alert query](docs/amtool_alert_query.jpg \"!amtool alert query\")\n\nYou can use regular expressions to match labels with the =~ operator. \nFor example, to list all alerts for http://localhost endpoints not depending on the port, \nyou can use the instance=~http://localhost.* matcher:\n\n```\n!amtool alert query instance=~http://localhost.*\n```\n\n## Geting alert details by fingerprint !amtool alert describe \u003cfingerprint\u003e\n\nGets more detailed info about alert from prometheus\n\n![!amtool alert describe](docs/amtool_alert_describe.jpg \"!amtool alert query\")\n\n## Muting alerts with !amtool silence add\n\nNow let's look at how to silence alerts using `amtool`.\n\nSilencing alerts lets you mute alerts based on the matcher for a given time. \nDuring that period, you'll not receive any email or Slack notification for the silenced alert.\n\nThe `!amtool silence add` command takes the matcher as an argument and creates a new silence \nbased on the matcher.\n\nTo define the expiration of an alert, use the `--expires` flag with desired duration of the silence,\nsuch as 1h or the --expire-on flag with the time of silence expiration in the RFC3339 format. \nFor example, the format `2019-10-04T07:50:00+00:00` represents `07.50am` on October 4th, 2019.\n\nIf the `--expires` or the `--expires-on` flag is not provided, \nalerts will be silenced for 1 hour.\n\nTo silence all alerts for the `http://localhost:8080` instance for `3` hours, \nyou'd use the following command:\n\n`!amtool silence add  instance=http://localhost:8080 --expires 3h` \n\nThe output contains an identification number for the silence, so make sure to note it down\nas you'll need it in case you want to remove the silence:\n\nOutput\n```\n4e89b15b-0814-41d3-8b74-16c513611732\n```\n\nIf you want to provide additional information when creating the silence, \nsuch as the author and comments, use the `--author` and `--comment` flags:\n\n`!amtool silence add severity=critical --expires 3h --author \"Sammy The Shark\" --comment \"Investigating the progress\"`\nLike before, the output contains the ID of the silence:\n\nOutput\n```\n12b7b9e1-f48a-4ceb-bd85-65ac882ceed1\n```\n\n## Querying current silences `!amtool silence query \u003cmatchers\u003e | -` \n\nThe command `!amtool silence query` \nwill show the list of all non-expired silences:\n\n```\n!amtool silence query -\n```\n\nNote: use `-` to indicate absence of specific filter criteria. \n\nThe output contains the ID of the silence, the list of matchers, the expiration timestamp, the author, and a comment:\n\nOutput\n\n```\nID                                    Matchers                        Ends At                  Created By       Comment\n12b7b9e1-f48a-4ceb-bd85-65ac882ceed1  severity=critical               2018-04-04 08:02:58 UTC  Sammy The Shark  Investigating in the progress\n4e89b15b-0814-41d3-8b74-16c513611732  instance=http://localhost:8080  2018-04-04 08:14:21 UTC  sammy\n```\n\nSimilar to the alert query command, you can use label matchers to filter the output by labels attached on creation:\n\n```\n!amtool silence query instance=http://localhost:8080\n```\nLike before, the output will include the ID number and details of the alert:\n\nOutput\n```\nID                                    Matchers                        Ends At                  Created By  Comment\n4e89b15b-0814-41d3-8b74-16c513611732  instance=http://localhost:8080  2018-04-04 08:14:21 UTC  sammy\n```\n\n\n\n\nFinally, to expire a silence, use the `!amtool silence expire` with the ID of the silence\n you want to expire:\n\n```\n!amtool silence expire 12b7b9e1-f48a-4ceb-bd85-65ac882ceed1\n```\n\n## Deleting silence with !amtool silence expire\n```\namtool silence expire 4e89b15b-0814-41d3-8b74-16c513611732\n```\nNo output represents successful command execution. \nIf you see an error, make sure you provided the correct ID of the silence.\n\n\n## Dirty alert suppressing !amtool suppress \u003cfingerprint\u003e\n\n```\namtool_suppress [-h] [--comment COMMENT] [--author AUTHOR]\n                      [--minutes MINUTES] [--hours HOURS] [--days DAYS]\n                      [--weeks WEEKS]\n                      matchers [matchers ...]\n```                      \n\nAssuming, you are ok to suppress alert using the labels from alert itself,\nyou can use !alert suppress \u003cfingerprint\u003e labels-to-pick command\n\n`!amtool suppress \u003cfingerprint\u003e instance` - suppress all alerts with instance equal \nto instance from alerts.\n\nAuthor, comment, minutes, hours, days are the optional arguments to tune silence duration \n    and description.\n        \n![!amtool suppress](docs/amtool_suppress.jpg \"!amtool suppress\")\n\n`!amtool suppress \u003cfingerprint\u003e`  - suppress single alert using all the alert labels (except known ignored one)\nas a match\n\n`!amtool suppress \u003cfingerprint\u003e`\n\nAs with any other silence, you can expire it issuing `!amtool silence expire` command.\n\n```\n!amtool silence expire 496715de-4c89-40ff-911d-8e4edb47e400\nSilence deleted\n```\n\n## Brief for alerts !amtool alerts\n\nThis is alternative template , that returns more information about every alert.\nDetails level: high\n\n```md\n\nFor *active* True, *silenced* True, *inhibited* True, *unprocessed* True, *filter* [], *receiver*\nFound *3* alerts.\n\n*Alert Firing:*\nLess than 10% disk space left;; *4.307%*\n\nConsider sshing into the instance and removing old logs, clean\ntemp files, or remove old apt packages with `apt-get autoremove`\n\n*Details:*\n*alertname:* `LowDiskSpace`  *device:* `/dev/xvda1`  *env:* `sim`  *fstype:* `ext4`  *instance:* `i-028ae8bf36be2e188`  *job:* `node`  *monitor:* `master`  *mountpoint:* `/`  *name:* `SIM host`    *severity:* `warn`\nState `active`, inhibited by `[]`, silenced by []\nStarted `2019-02-20T11:24:34.521Z` , updated  `2019-02-24T21:20:19.524Z`\n_!amtool suppress af2442fa7f7ee655_\n\n```\n\n## Brief for alerts !amtool brief\n\nThis is alternative template ,  with full list of currently active alerts with moderate details level\n\n![!amtool brief](docs/amtool_brief.jpg \"!amtool brief\")\n\n\nContributing\n------------\n\nContributions to this plugin are always welcome and highly encouraged.\n\nLicense\n-------\n\nMIT - See LICENSE for more information.\n\n\nInterested in other plugins or roles ?\n--------------------------------------\n\nSubscribe for roles updates at [FB] (https://www.facebook.com/SoftAsap/)\n\nJoin gitter discussion channel at [Gitter](https://gitter.im/softasap)\n\nDiscover other roles at  http://www.softasap.com/roles/registry_generated.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronenko%2Ferrbot-prometheus-alertmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoronenko%2Ferrbot-prometheus-alertmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoronenko%2Ferrbot-prometheus-alertmanager/lists"}