{"id":18834466,"url":"https://github.com/fgouteroux/atm","last_synced_at":"2025-07-03T07:32:38.988Z","repository":{"id":248228545,"uuid":"822673019","full_name":"fgouteroux/atm","owner":"fgouteroux","description":"Alertmanager silences distributor multi-tenants","archived":false,"fork":false,"pushed_at":"2024-07-02T13:45:19.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T18:15:00.625Z","etag":null,"topics":["alertmanager","amtool","multi-tenants","prometheus","silences"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fgouteroux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2024-07-01T15:25:33.000Z","updated_at":"2024-07-02T14:17:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"2517b8ac-c6d9-4594-8e00-696c01d560ad","html_url":"https://github.com/fgouteroux/atm","commit_stats":null,"previous_names":["fgouteroux/atm"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fgouteroux/atm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fatm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fatm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fatm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fatm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fgouteroux","download_url":"https://codeload.github.com/fgouteroux/atm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fgouteroux%2Fatm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263282680,"owners_count":23442213,"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","amtool","multi-tenants","prometheus","silences"],"created_at":"2024-11-08T02:12:34.382Z","updated_at":"2025-07-03T07:32:38.970Z","avatar_url":"https://github.com/fgouteroux.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# atm (alertmanager tenants mute)\n\n...aka Alertmanager silences distributor\n\nThis a dirty copy of [amtool](https://github.com/prometheus/alertmanager?tab=readme-ov-file#amtool) which allow to create silence for multi-tenants.\n\nIt support the same config file format, but has only the `silence add` cmd.\n\n## usage\n\n```\nusage: atm silence add [\u003cflags\u003e] [\u003cmatcher-groups\u003e...]\n\nAdd a new alertmanager silence\n\n    atm uses a simplified Prometheus syntax to represent silences. The\n    non-option section of arguments constructs a list of \"Matcher Groups\"\n    that will be used to create a number of silences. The following examples\n    will attempt to show this behaviour in action:\n\n    atm silence add alertname=foo node=bar\n\n    This statement will add a silence that matches alerts with the\n    alertname=foo and node=bar label value pairs set.\n\n    atm silence add foo node=bar\n\n    If alertname is omitted and the first argument does not contain a '=' or a\n    '=~' then it will be assumed to be the value of the alertname pair.\n\n    atm silence add 'alertname=~foo.*'\n\n    As well as direct equality, regex matching is also supported. The '=~' syntax\n    (similar to Prometheus) is used to represent a regex match. Regex matching\n    can be used in combination with a direct match.\n\nFlags:\n  -h, --[no-]help               Show context-sensitive help (also try --help-long and --help-man).\n      --date.format=\"2006-01-02 15:04:05 MST\"  \n                                Format of date output\n      --alertmanager.url=ALERTMANAGER.URL  \n                                Alertmanager to talk to\n      --timeout=30s             Timeout for the executed command\n      --http.config.file=\u003cfilename\u003e  \n                                HTTP client configuration file for atm to connect to Alertmanager.\n      --[no-]version            Show application version.\n  -t, --tenant=TENANT           tenant\n      --tenant.http-header=\"X-Scope-OrgID\"\n                                tenant HTTP Header\n      --tenant.file=\u003cfilename\u003e  tenant file location\n  -a, --author=\"fgouteroux\"     Username for CreatedBy field\n  -d, --duration=\"1h\"           Duration of silence\n      --max-duration=\"12h\"      Max Duration of silence\n      --start=START             Set when the silence should start. RFC3339 format\n                                2006-01-02T15:04:05-07:00\n      --end=END                 Set when the silence should end (overwrites duration). RFC3339 format\n                                2006-01-02T15:04:05-07:00\n  -c, --comment=COMMENT         A comment to help describe the silence\n\nArgs:\n  [\u003cmatcher-groups\u003e]  Query filter\n\n```\n\n## How it works\n\nWhen using grafana mimir with multi-tenancy enabled, we need to pass the HTTP tenant ID header.\n\natm take a tenants list file and iterate over each tenant, set the expected header ( `X-Scope-OrgID` by default) and create the silence.\n\nWe add a default max duration of 12h by default to avoid muting all tenants alerts for a long time.\n\n### Create multi-tenants silences\n\nexamples/tenants.conf\n```\ntenant-a\ntenant-b\n```\n\nAdd silence on all tenants in examples/tenants.conf file\n\n```\natm silence add alertname=\"test\" --comment test-alert --duration 10m --tenant.file examples/tenants.conf\nSilence added for 'tenant-a' tenant: 1fb1199b-6aec-4575-b6d4-cc5631b77326\nSilence added for 'tenant-b' tenant: 0fed624d-2e62-43b8-a940-a337f40e4f05\n```\n\n## Limitations\n\natm couldn't view/expire silences because a silence could be created multiple time with the same matcher, so it's hard to know which silence to expire.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgouteroux%2Fatm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffgouteroux%2Fatm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffgouteroux%2Fatm/lists"}