{"id":21479364,"url":"https://github.com/rycus86/github-prometheus-exporter","last_synced_at":"2025-07-15T11:31:40.051Z","repository":{"id":66144729,"uuid":"138092935","full_name":"rycus86/github-prometheus-exporter","owner":"rycus86","description":"Prometheus exporter for GitHub statistics","archived":false,"fork":false,"pushed_at":"2022-01-11T00:42:49.000Z","size":455,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T03:24:05.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/rycus86.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-06-20T22:34:50.000Z","updated_at":"2020-12-23T22:18:26.000Z","dependencies_parsed_at":"2023-02-21T16:45:21.380Z","dependency_job_id":null,"html_url":"https://github.com/rycus86/github-prometheus-exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rycus86/github-prometheus-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-prometheus-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-prometheus-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-prometheus-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-prometheus-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rycus86","download_url":"https://codeload.github.com/rycus86/github-prometheus-exporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rycus86%2Fgithub-prometheus-exporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265431625,"owners_count":23764031,"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":[],"created_at":"2024-11-23T11:24:56.077Z","updated_at":"2025-07-15T11:31:40.043Z","avatar_url":"https://github.com/rycus86.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometheus exporter for GitHub stats\n\nA small Go application to periodically pull statistics and metrics from GitHub, and expose them in a [Prometheus](https://prometheus.io/)-compatible format.\n\n## Usage\n\nYou can easily run the application from its [Docker image](https://hub.docker.com/r/rycus86/github-exporter/):\n\n```shell\n$ docker run --rm -it -p 8080:8080 rycus86/github-exporter \u003cflags\u003e\n```\n\nThe command line parameters are like this:\n\n```\nUsage of /exporter:\n  -credentials path\n        File path containing the authentication details in `username:password` format (optional)\n  -interval duration\n        Interval between checks (default 15m0s)\n  -org value\n        Organizations to list repositories for (multiple values are allowed)\n  -password string\n        Password for authenticated API calls (optional)\n  -port int\n        The HTTP port to listen on (default 8080)\n  -skip-forks\n        Do not pull metrics for forked repositories\n  -timeout duration\n        HTTP API call timeout (default 15s)\n  -user value\n        Users to list repositories for (multiple values are allowed)\n  -username string\n        Username for authenticated API calls (optional)\n```\n\nThe Docker image reference points to a multi-arch manifest, with the actual images being available for the `amd64`, `armhf` and `arm64v8` platforms.\n\n### Selecting targets\n\nYou can specify the GitHub user or organization to list repositories from multiple times:\n\n```shell\n$ docker run --rm -it -p 8080:8080 rycus86/github-exporter \\\n      -user one -user two -org three -org four -org five\n```\n\nYou can also add the `-skip-forks` flag to exclude any repositories the user or organization has forked, rather than creating it themselves.\n\n### Authentication and rate limits\n\nThe application uses the [v3 GitHub API](https://developer.github.com/v3/) through the [google/go-github](https://github.com/google/go-github) library, and it allows you to either make anonymous requests to the API with lower call rate limits, or authenticated requests with higher limits. For the moment, basic authentication is supported with a provided username and password.\n\nYou can either use the `-username` and `-password` to supply the credentials, though be aware that this would make them show up on process listings with `ps` for example! A more secure way would be adding in a credentials file, perhaps with a bind-mount, or as a *secret* if you're using Docker Swarm mode.\n\n```shell\n$ docker run --rm -it -v $PWD/github.creds:/var/secret/credentials \\\n      rycus86/github-exporter -credentials /var/secret/credentials -user userA\n```\n\nThe application also leverages the [gregjones/httpcache](https://github.com/gregjones/httpcache) library to make [conditional requests](https://developer.github.com/v3/#conditional-requests) to GitHub, which won't count against the rate limit.\n\n## Metrics\n\nThe following metrics are exposed on the `/metrics` endpoint:\n\n```shell\n$ curl -s http://localhost:8080/metrics | grep github_\n# HELP github_forks_count Number of Forks\n# TYPE github_forks_count gauge\ngithub_forks_count{owner=\"rycus86\",repository=\"prometheus_flask_exporter\"} 3\n# HELP github_open_issues_count Number of Open Issues\n# TYPE github_open_issues_count gauge\ngithub_open_issues_count{owner=\"rycus86\",repository=\"prometheus_flask_exporter\"} 1\n# HELP github_rate_limit API Rate Limit\n# TYPE github_rate_limit gauge\ngithub_rate_limit 60\n# HELP github_rate_remaining API Rate Remaining\n# TYPE github_rate_remaining gauge\ngithub_rate_remaining 58\n# HELP github_rate_reset API Rate Reset\n# TYPE github_rate_reset gauge\ngithub_rate_reset 1.530000761e+12\n# HELP github_repo_count Number of Repositories\n# TYPE github_repo_count gauge\ngithub_repo_count{owner=\"rycus86\"} 59\n# HELP github_size_kilobytes Size of the Repository in kiloBytes\n# TYPE github_size_kilobytes gauge\ngithub_size_kilobytes{owner=\"rycus86\",repository=\"github-prometheus-exporter\"} 452\ngithub_size_kilobytes{owner=\"rycus86\",repository=\"podlike\"} 2070\ngithub_size_kilobytes{owner=\"rycus86\",repository=\"prometheus_flask_exporter\"} 186\n# HELP github_stargazers_count Number of Stars\n# TYPE github_stargazers_count gauge\ngithub_stargazers_count{owner=\"rycus86\",repository=\"podlike\"} 8\ngithub_stargazers_count{owner=\"rycus86\",repository=\"prometheus_flask_exporter\"} 10\n# HELP github_watchers_count Number of Watchers\n# TYPE github_watchers_count gauge\ngithub_watchers_count{owner=\"rycus86\",repository=\"podlike\"} 8\ngithub_watchers_count{owner=\"rycus86\",repository=\"prometheus_flask_exporter\"} 10\n```\n\n## Acknowledgements\n\nThe application was inspired by [infinityworks/github-exporter](https://github.com/infinityworks/github-exporter).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Fgithub-prometheus-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frycus86%2Fgithub-prometheus-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frycus86%2Fgithub-prometheus-exporter/lists"}