This project extract many github statistic for prometheus. It acheives it's goal by leverage the fabulous octokit project. It also 100% respect github rate limits by using this extremely useful throttling-plugin project.
All metrics can be found in src/metrics.ts
file.
Some notable metrics are :
- Total number of repositories, private and public per organization.
- Total number of stars and issues per repository.
- Total number of branch per repository.
- Total number of pull request, open, merged and closed per repo and per organization.
- Total number of pull request that are waiting to be approved, are approved but not merged
docker build . -t prometheus-exporter-github
docker run -e GITHUB_ORGANIZATION=org -e LOG_LEVEL=silly -p 8080:8080 --rm -it prometheus-exporter-github
Server is accessible on http://localhost/metrics
For development, add sources
cd prometheus-exporter-github
docker run -e GITHUB_TOKEN=your-github-personnal-token -e GITHUB_ORGANIZATION=org -e LOG_LEVEL=silly -v $(pwd):/app -p 8080:8080 --rm -it prometheus-exporter-github
A docker-compose file provide integration with prometheus server.
export GITHUB_TOKEN=your-github-personnal-token
export GITHUB_ORGANIZATION=org
docker-compose up
docker run -v $(pwd):/app --rm -it prometheus-exporter-github tslint
Value in silly
, debug
, verbose
, info
, warn
, error
.
Default info
.
See winston.
Value in json
, prettyPrint
. Some format described in winston documentation may not be working so stick with prettyPrint
or json
unless you know what you are doing.
Default json
.
See log format for more possible format.
Value in development
, production
.
Default production
.
Personal access token, OAuth access token, GitHub app bearer token or GitHub app installation token. If you need access to private repositories add the whole repo
scope.
See get a Github token.
Organization name.
Port number the http server will listen to.
Default 8080
.