{"id":20592976,"url":"https://github.com/fusakla/prometheus-gitlab-notifier","last_synced_at":"2025-09-21T17:14:03.111Z","repository":{"id":64304166,"uuid":"201788848","full_name":"FUSAKLA/prometheus-gitlab-notifier","owner":"FUSAKLA","description":"Create Gitlab issues from prometheus alerts automatically","archived":false,"fork":false,"pushed_at":"2023-10-13T13:03:09.000Z","size":171,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T22:56:07.057Z","etag":null,"topics":["alerting","gitlab","monitoring","prometheus"],"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/FUSAKLA.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":"2019-08-11T16:29:27.000Z","updated_at":"2024-07-08T20:45:32.000Z","dependencies_parsed_at":"2024-06-20T11:02:08.913Z","dependency_job_id":"9de89b6d-64d2-47a9-a04f-345fc9c419c7","html_url":"https://github.com/FUSAKLA/prometheus-gitlab-notifier","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FUSAKLA%2Fprometheus-gitlab-notifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FUSAKLA%2Fprometheus-gitlab-notifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FUSAKLA%2Fprometheus-gitlab-notifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FUSAKLA%2Fprometheus-gitlab-notifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FUSAKLA","download_url":"https://codeload.github.com/FUSAKLA/prometheus-gitlab-notifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248975330,"owners_count":21192208,"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":["alerting","gitlab","monitoring","prometheus"],"created_at":"2024-11-16T07:47:05.170Z","updated_at":"2025-09-21T17:13:58.069Z","avatar_url":"https://github.com/FUSAKLA.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus Gitlab Notifier\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/fusakla/prometheus-gitlab-notifier/go.yml)](https://github.com/FUSAKLA/prometheus-gitlab-notifier/actions)\n[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/fusakla/prometheus-gitlab-notifier)](CHANGELOG.md)\n[![Docker Pulls](https://img.shields.io/docker/pulls/fusakla/prometheus-gitlab-notifier)](https://cloud.docker.com/repository/docker/fusakla/prometheus-gitlab-notifier)\n\nTool which implements [Alertmanager](https://github.com/prometheus/alertmanager) webhook notifier\nand creates Gitlab issue based on the the alert. It allows you to define own issue template using the Go template, labeling scheme\nof the resulting issue and group the alerts to a singe issue to avoid flooding yourself with identical issues.\n\n\u003e This is probably possible in the Ultimate version of GitLab using\n\u003e the [Prometheus integration](https://docs.gitlab.com/ee/user/project/integrations/prometheus.html#setting-up-alerts-for-prometheus-metrics-ultimate),\n\u003e so if you have the possibility maybe first try that.\n\nFor new features or changes check out the [CHANGELOG.md](./CHANGELOG.md)\n\n### How to run it\n```\n$ ./prometheus-gitlab-notifier --help\nusage: prometheus-gitlab-notifier --gitlab.token.file=GITLAB.TOKEN.FILE --project.id=PROJECT.ID [\u003cflags\u003e]\n\nWeb server listening for webhooks of alertmanager and creating an issue in Gitlab based on it.\n\nFlags:\n  --help                         Show context-sensitive help (also try --help-long and --help-man).\n  --debug                        Enables debug logging.\n  --log.json                     Log in JSON format\n  --server.addr=\"0.0.0.0:9629\"   Allows to change the address and port at which the server will listen for incoming connections.\n  --gitlab.url=\"https://gitlab.com\"\n                                 URL of the Gitlab API.\n  --gitlab.token.file=GITLAB.TOKEN.FILE  \n                                 Path to file containing gitlab token.\n  --project.id=PROJECT.ID        Id of project where to create the issues.\n  --group.interval=1h            Duration how long back to check for opened issues with the same group labels to append the new alerts to (go duration syntax allowing 'ns', 'us' , 'ms', 's', 'm', 'h').\n  --issue.label=ISSUE.LABEL ...  Labels to add to the created issue. (Can be passed multiple times)\n  --dynamic.issue.label.name=DYNAMIC.ISSUE.LABEL.NAME ...  \n                                 Alert label, which is to be propagated to the resulting Gitlab issue as scoped label if present in the received alert. (Can be passed multiple times)\n  --issue.template=ISSUE.TEMPLATE\n                                 Path to the issue golang template file.\n  --queue.size.limit=100         Limit of the alert queue size.\n  --retry.backoff=5m             Duration how long to wait till next retry (go duration syntax allowing 'ns', 'us' , 'ms', 's', 'm', 'h').\n  --retry.limit=5                Maximum number of retries for single alert. If exceeded it's thrown away.\n  --graceful.shutdown.wait.duration=30s  \n                                 Duration how long to wait on graceful shutdown marked as not ready (go duration syntax allowing 'ns', 'us' , 'ms', 's', 'm', 'h').\n```\n\nTo test it is running check logs or http://0.0.0.0:9629/readiness\n\n### Try it out\nYou can send a test alert to it using the prepared alert JSON by running thin in root of this repo\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d @./conf/alert.json http://localhost:9629/api/alertmanager\n```\n\n### Issue template\nLook of the resulting issue in Gitlab can be customized using [Go template](https://golang.org/pkg/text/template/).\nDefault template can be found in [conf/default_issue.tmpl](conf/default_issue.tmpl).\nThe available data during templating is the Alertmanager webhook message struct itself.\nExample can be found in [conf/alert.json](conf/alert.json).\nTo use own template override the default one with the `--issue.template` flag.\n\u003e The template is validated on startup but if even after validation the templating\nfails in the runtime, raw JSON of the alert will be pasted to the text of the issue as a fallback.\n\nExample of the default template:\n\n![Issue example](conf/issue_example.png)\n\n### Configure Alertmanager\nYou just need to add the [`\u003cwebhook_config\u003e`](https://prometheus.io/docs/alerting/configuration/#webhook_config)\nreceiver to your Alertmanager configuration and disable sending resolved notifications with `send_resolved: false`.\nAlso better to set the `repeat_interval` to higher value.\n\nSee the minimal example in the [conf/alertmanager_conf.yaml](conf/alertmanager_conf.yaml).\n\n\n### Issue labeling scheme\nThe Gitlab notifier allows to label the resulting issue based on the alert labels.\nIt uses mostly Gitlab scoped labels in format `label::value`.\nThe grouping labels of the alert are added to the issue automatically to allow identifying same \nalerts (more on that in [Grouping](#Grouping) section).\nAdditionally, you can specify names of labels to be also added to the issue using flag `--dynamic.issue.label.name`.\nLast thing you can add are static labels which will be added to every issue using flag `--issue.label`,\n\n\n### Grouping\nTo avoid flooding gitlab with identical alerts if they happen to fire and resolve again and again, \nGitlab notifier checks for issues witch the same grouping labels as the new incoming alert.\nIf if it finds any still open issue younger than `1h` by default (can be controlled by flag `--group.interval`),\nit only appends the rendered template to the end of the issue description \nand adds to the issue label `appended-alerts::\u003cnumber\u003e` witch count of how many times it was updated. \n\n\n### Deployment\nExample kubernetes manifests can be found at [kubernetes/](./kubernetes)\n\n\n### Instrumentation\n\n- `/liveness`: liveness endpoint returns always 200\n- `/readiness`: tries HEAD request to the configured Gitlab URL and fails if it does not succeeds. \n- `/metrics`: metrics endpoint returning app runtime metrics in Prometheus format\n\n### How to contribute and release\n\n**Contributing:**\n1. Implement your changes and test them on your own testing repository.\n1. Add note about changes made to the [CHANGELOG.md](CHANGELOG.md) `Unreleased` section.\n1. Create PR and apply for CR from maintainers.\n1. Get it merged.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusakla%2Fprometheus-gitlab-notifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffusakla%2Fprometheus-gitlab-notifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffusakla%2Fprometheus-gitlab-notifier/lists"}