{"id":13585313,"url":"https://github.com/theodore86/github-rate-limits-exporter","last_synced_at":"2026-02-07T14:15:00.808Z","repository":{"id":63851636,"uuid":"555752392","full_name":"theodore86/github-rate-limits-exporter","owner":"theodore86","description":"Github API Rate Limits Exporter for Prometheus","archived":false,"fork":false,"pushed_at":"2025-06-14T10:16:24.000Z","size":866,"stargazers_count":13,"open_issues_count":15,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-14T11:24:36.437Z","etag":null,"topics":["alertmanager","automation","exporter","github","grafana","kubernetes","monitoring","observability","prometheus","python"],"latest_commit_sha":null,"homepage":"","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/theodore86.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-22T08:38:08.000Z","updated_at":"2025-06-14T10:15:09.000Z","dependencies_parsed_at":"2024-02-16T20:30:35.118Z","dependency_job_id":"83030329-a45d-487d-8da4-609734bad18d","html_url":"https://github.com/theodore86/github-rate-limits-exporter","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/theodore86/github-rate-limits-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodore86%2Fgithub-rate-limits-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodore86%2Fgithub-rate-limits-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodore86%2Fgithub-rate-limits-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodore86%2Fgithub-rate-limits-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theodore86","download_url":"https://codeload.github.com/theodore86/github-rate-limits-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theodore86%2Fgithub-rate-limits-exporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261510008,"owners_count":23169686,"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","automation","exporter","github","grafana","kubernetes","monitoring","observability","prometheus","python"],"created_at":"2024-08-01T15:04:52.139Z","updated_at":"2026-02-07T14:15:00.674Z","avatar_url":"https://github.com/theodore86.png","language":"Python","readme":"# github-rate-limits-exporter\n\n[![Charts CI](https://github.com/theodore86/github-rate-limits-exporter/actions/workflows/chart-linting-and-testing.yml//badge.svg)](https://github.com/theodore86/github-rate-limits-exporter/actions/workflows/chart-linting-and-testing.yml)\n[![PyPI version](https://badge.fury.io/py/github-rate-limits-exporter.svg)](https://badge.fury.io/py/github-rate-limits-exporter)\n[![Python version](https://img.shields.io/pypi/pyversions/github-rate-limits-exporter.svg)](https://img.shields.io/pypi/pyversions/github-rate-limits-exporter.svg)\n![license](https://img.shields.io/github/license/theodore86/github-rate-limits-exporter)\n\nPrometheus exporter to monitor the Github API rate-limits.\n\n![Github API Rate Limits - Grafana dashboard](./docs/gh-rl-grafana-dashboard.png)\n\n## Introduction\n\nIf you have ever tried using Github's API, you have probably already run into Github's rate limiting errors.\u003c/br\u003e\nWithout authorization, Github only allows **60 requests per hour** (!!), and after creating and using your\u003c/br\u003e\nown personal access token, you are upgraded to *5000 requests per hour*.\n\nThat rate limit can be easily reached in just a few minutes by calling the API to list basic information from a medium\u003c/br\u003e\nsized repository and you would have **to wait 50+ minutes** for the rate limit to reset in order to continue or try again.\u003c/br\u003e\nYou can up the rate limit to *15,000* with an enterprise account but the problem remains the same:\n\n*If your service/program needs to make consistent and/or sustained requests to Github's APIs,\u003c/br\u003e\nyou will have to work around and make the most of Github's rate limits.*\n\nSo, the *Prometheus Github rate-limits exporter* was introduced to expose the *remaining*, *used*, *limit*\u003c/br\u003e\n(quotas) and *reset* (rate-limit window resets in UTC seconds) information per Github API as metrics in order\u003c/br\u003e\nto create alerting events and (Grafana) monitoring dashboards.\n\nFor the exporter to fetch and expose the Github API rate-limits, you need to supply:\n\n- a [GitHub Personal Access Token (PAT)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)\n- or [GitHub App (APP) credentials](https://docs.github.com/en/free-pro-team@latest/developers/apps/authenticating-with-github-apps).\n\n## As standalone Python command line tool (pypi)\n\nInstall the tool through [pypi](https://pypi.org/project/github-rate-limits-exporter/):\n\n```bash\npip3 install github-rate-limits-exporter\n./github-rate-limits-exporter --help\n```\n\n## Tox (wrapper)\n\nClone the repository and install ``tox``:\n\n```bash\npip install --user tox\n```\n\n### Run as ``PAT`` Github authentication type\n\n```bash\ntox -e run-exporter -- \\\n  --github-auth-type pat \\\n  --github-account my_account_name \\\n  --github-token my_token\n```\n\n### Run as ``APP`` (Github App) Github authentication type\n\n```bash\ntox -e run-exporter -- \\\n  --github-auth-type app \\\n  --github-account my_account_name \\\n  --github-app-id my_app_id \\\n  --github-app-installation-id my_installation_id \\\n  --github-app-private-key-path /path/to/private_key.pem\n```\n\n## Docker\n\nClone the repositroy and build the docker container image:\n\n```bash\ndocker build -t prometheus-gh-rate-limit-exporter:latest .\n```\n\nor pull directly from [Docker Hub](https://hub.docker.com/r/theodore86/prometheus-gh-rate-limit-exporter):\n\n```bash\ndocker pull theodore86/prometheus-gh-rate-limit-exporter:latest\n```\n\n### Run as PAT Github authentication type\n\n```bash\ndocker run -p 10050:10050 -d \\\n  --name gh-rl-exporter \\\n  --restart on-failure \\\n  -e GITHUB_ACCOUNT=my_account_name \\\n  -e GITHUB_AUTH_TYPE=pat \\\n  -e GITHUB_TOKEN=my_token \\\n  -e EXPORTER_LOG_LEVEL=4 \\\n  prometheus-gh-rate-limit-exporter:latest\n```\n\n### Run as APP (Github App) Github authentication type\n\n```bash\ndocker run -p 10050:10050 -d \\\n  --name gh-rl-exporter \\\n  --restart on-failure \\\n  -e GITHUB_AUTH_TYPE=app \\\n  -e GITHUB_ACCOUNT=my_account_name \\\n  -e GITHUB_APP_ID=111111 \\\n  -e GITHUB_APP_INSTALLATION_ID=22222222 \\\n  -e GITHUB_APP_PRIVATE_KEY_PATH=/app/key.pem \\\n  -e EXPORTER_LOG_LEVEL=4 \\\n  --mount type=bind,source=/ws/key.pem,target=/app/key.pem,readonly \\\n  prometheus-gh-rate-limit-exporter:latest\n```\n\n## Docker-Compose\n\nAnother way to test and observe the exporter is through the ``Prometheus/Grafana/AlertManager``\u003c/br\u003e\nstack on top of the [docker-compose](https://pypi.org/project/docker-compose/):\n\nClone the repository and install ``tox`` tool:\n\n```bash\npip install --user tox\n```\n\n### Run as PAT Github authentication type\n\n```bash\nexport GITHUB_AUTH_TYPE=pat\nexport GITHUB_TOKEN=your_token\nexport GITHUB_ACCOUNT=your_account\nexport EXPORTER_LOG_LEVEL=4\nexport GF_SECURITY_ADMIN_USER=username\nexport GF_SECURITY_PASSWORD=password\ntox -e dc-run\n```\n\n### Run as APP (Github App) authentication type\n\n```bash\nexport GITHUB_ACCOUNT=your_account\nexport GITHUB_AUTH_TYPE=app\nexport GITHUB_APP_ID=12345\nexport GITHUB_APP_INSTALLATION_ID=123456\nexport GITHUB_APP_SRC_PRIVATE_KEY_PATH=/ws/private_key.pem\nexport GITHUB_APP_PRIVATE_KEY_PATH=/tmp/private_key.pem\nexport EXPORTER_LOG_LEVEL=4\nexport GF_SECURITY_ADMIN_USER=username\nexport GF_SECURITY_PASSWORD=password\ntox -e dc-run\n```\n\n### Connect to Portainer management UI\n\n- [Portainer](https://localhost:9443) (credentials: *admin/adminpassword*)\n\n### Connect to Prometheus, Grafana and AlertManager\n\n- [Prometheus](http://localhost:9090)\n- [Grafana](http://localhost:3000)\n- [AlertManager](http://localhost:9093)\n\nSee also the existing examples:\n\n- [Grafana dashboards](./monitoring/grafana/dashboards/sample.json)\n- [Alertmanager rules](./monitoring/prometheus/rules/alerts.yml)\n\n### Cleanup/teardown the composed services\n\n```bash\ntox -e dc-clean\n```\n\n## Kubernetes - Helm chart\n\n[This helm chart](charts/github-rate-limits-exporter/README.md) helps to install and configure github-rate-limits exporter on Kubernetes clusters.\n\n### In order to try out (locally) the charts\n\n- Install:\n\n  - [Devbox](https://github.com/jetify-com/devbox)\n\n\n```bash\ncurl -fsSL https://get.jetify.com/devbox | bash\n```\n\n- Create the cluster:\n\n```bash\ncd kubernetes; devbox run start-cluster\n```\n\n- Adjust the environment file (*.env*):\n\n```bash\nvim .env\n```\n\n- Bring up the *github-rate-limits exporter* and the Kubernetes Prometheus stack:\n\n```bash\ndevbox run --env-file .env start-monitor\n```\n\n### Cleanup/teardown the workloads\n\n```bash\ndevbox run --env-file .env stop-monitor\n```\n\n```bash\ndevbox run stop-cluster\n```\n\n## Other Projects\n\n- [Github Rate Limits Exporter - written in GO](https://github.com/kalgurn/github-rate-limits-prometheus-exporter)\n\n## References\n\n- [creating-a-personal-access-token](https://docs.github.com/en/enterprise-server@3.4/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)\n- [creating-a-github-app](https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-a-github-app)\n- [installing-github-apps-in-your-organization](https://docs.github.com/en/free-pro-team@latest/github/customizing-your-github-workflow/installing-an-app-in-your-organization)\n- [installing-github-apps-in-your-repository](https://docs.github.com/en/free-pro-team@latest/developers/apps/installing-github-apps)\n- [how-to-get-most-out-of-github-api-rate-limits](https://www.endorlabs.com/blog/how-to-get-the-most-out-of-github-api-rate-limits)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodore86%2Fgithub-rate-limits-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheodore86%2Fgithub-rate-limits-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheodore86%2Fgithub-rate-limits-exporter/lists"}