https://github.com/kalgurn/github-rate-limits-prometheus-exporter
GitHub Rate Limits Prometheus exporter. Works with both App and PAT credentials
https://github.com/kalgurn/github-rate-limits-prometheus-exporter
github-rate-limit go prometheus prometheus-exporter
Last synced: 2 months ago
JSON representation
GitHub Rate Limits Prometheus exporter. Works with both App and PAT credentials
- Host: GitHub
- URL: https://github.com/kalgurn/github-rate-limits-prometheus-exporter
- Owner: kalgurn
- License: mit
- Created: 2021-12-12T06:52:25.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-07-17T06:02:45.000Z (8 months ago)
- Last Synced: 2025-07-17T15:49:17.816Z (8 months ago)
- Topics: github-rate-limit, go, prometheus, prometheus-exporter
- Language: Go
- Homepage:
- Size: 247 KB
- Stars: 14
- Watchers: 1
- Forks: 9
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://sonarcloud.io/summary/new_code?id=kalgurn_github-rate-limits-prometheus-exporter)
[](https://sonarcloud.io/summary/new_code?id=kalgurn_github-rate-limits-prometheus-exporter)
[](https://sonarcloud.io/summary/new_code?id=kalgurn_github-rate-limits-prometheus-exporter)
[](https://artifacthub.io/packages/search?repo=github-rate-limit-prometheus-exporter)
# Github Rate Limit Prometheus Exporter
A [prometheus](https://prometheus.io/) exporter which scrapes GitHub API for the rate limits used by PAT/GitHub App.
Helm Chart with values and deployment can be found [here](./helm/github-rate-limits-prometheus-exporter)
For the exporter to run you need to supply either a GitHub Token or a set of a GitHub App credentials, alongside with a type of authentication to use(pat/app)
You can use the environment variable `GITHUB_LOG_METRIC_COLLECTION` (boolean) to control if rate limit metrics are also logged to the console when they're collected by Prometheus. As the functionality is backed by [Golang `strconv.ParseBool`](https://pkg.go.dev/strconv#ParseBool), it accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False. Any other value or lack thereof will default to enabling logs.
### The metrics can then be represented on a [grafana](https://grafana.com) dashboard

## Docker
PAT
```sh
docker run -d \
-e GITHUB_AUTH_TYPE=PAT \
-e GITHUB_ACCOUNT_NAME=name_of_my_app
-e GITHUB_TOKEN=my_token \
-p 2112:2112 \
ghcr.io/kalgurn/grl-exporter:latest
```
GitHub APP
```
docker run -d \
-e GITHUB_AUTH_TYPE=APP \
-e GITHUB_APP_ID=my_app_id \
-e GITHUB_INSTALLATION_ID=my_app_installation_id \
-e GITHUB_ACCOUNT_NAME=name_of_my_app
-e GITHUB_PRIVATE_KEY_PATH=/tmp
-v $PWD/path_to/key.pem:/tmp/key.pem
-p 2112:2112 \
ghcr.io/kalgurn/grl-exporter:latest
```