https://github.com/jamesread/prometheus-github-exporter-micro
A GitHub prometheus exporter (micro = small, simple, python)
https://github.com/jamesread/prometheus-github-exporter-micro
maturity-prod prometheus prometheus-exporter
Last synced: 10 months ago
JSON representation
A GitHub prometheus exporter (micro = small, simple, python)
- Host: GitHub
- URL: https://github.com/jamesread/prometheus-github-exporter-micro
- Owner: jamesread
- License: agpl-3.0
- Created: 2021-12-04T13:23:57.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-23T11:10:51.000Z (about 1 year ago)
- Last Synced: 2025-09-15T08:58:52.053Z (10 months ago)
- Topics: maturity-prod, prometheus, prometheus-exporter
- Language: Python
- Homepage:
- Size: 38.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# prometheus-github-exporter (micro edition)
This is a GitHub exporter that exports basic metrics from GitHub.
[](#none)
[](https://discord.gg/jhYWWpNJ3v)
I wrote this because infinityworks/github-exporter looks to be semi-abandoned - several PRs being ignored, etc. If that project picks up again it may no longer make sense to maintain this exporter.
## Sample output
```ini
github_repo_stars{repo="olivetin/olivetin"} 303.0
github_repo_stars{repo="jamesread/prometheus-gmail-exporter"} 13.0
# HELP github_repo_issues GitHub Repo issues
# TYPE github_repo_issues gauge
github_repo_issues{repo="olivetin/olivetin"} 10.0
github_repo_issues{repo="jamesread/prometheus-gmail-exporter"} 0.0
# HELP github_repo_forks GitHub Repo forks
# TYPE github_repo_forks gauge
github_repo_forks{repo="olivetin/olivetin"} 11.0
github_repo_forks{repo="jamesread/prometheus-gmail-exporter"} 4.0
# HELP github_repo_subscribers GitHub Repo subscribers
# TYPE github_repo_subscribers gauge
github_repo_subscribers{repo="olivetin/olivetin"} 8.0
github_repo_subscribers{repo="jamesread/prometheus-gmail-exporter"} 3.0
```
## Installation / Usage
### Option 1) Docker image
Published on dockerhub as `docker.io/jamesread/prometheus-github-exporter-micro`.
Example usage;
```
docker create --name gh_exporter -p 9171 -e REPOS="olivetin/olivetin,upsilonproject/upsilon-drone,upsilonproject/upsilon-custodian" jamesread/prometheus-github-exporter-micro
```
### Option 2) Clone this repo and run the script.
^^ :-)
## Configuration
Configuration is from environment variables only.
* `REPOS` - a comma-delimited list of repos you want to get metrics for. eg: `export REPOS="olivetin/olivetin,jamesread/prometheus-gmail-exporter"
* `USERS` - a comma-delimited list of users you want to get metrics for (iterate over all repos). eg: `export USERS="jamesread"`
* `PROM_PORT` - The port for the HTTP server to listen on, by default it is `9171`.
* `GITHUB_TOKEN` - A 32-character GitHub API token, otherwise requests to the API as a guest are likely to be rate limited quickly.
* `UPDATE_DELAY_SECONDS` - How long to sleep between updating all repos. Default `3600` seconds.