Sign inSign up

zetaplusae/github-prometheus-exporter

By zetaplusae

Updated over 5 years ago

A docker image that exposes metrics about your Github repository in Prometheus format.

Image
0

1.2K

zetaplusae/github-prometheus-exporter repository overview

github-prometheus-exporter

GitHub top language GitHub Docker Build Docker Image Size (latest by date)

A docker image that exposes metrics about your Github repository in Prometheus format.

docker pull zetaplusae/github-prometheus-exporter

Metrics

Metric NameHelp
github_repo_starsRepository Stars
github_assets_download_countRelease Assets Download Count
github_assets_sizeRelease Assets Size
github_assets_countRelease Assets Count

Example

# <your-repository-name>
# e.g. predatorray/github-prometheus-exporter

docker run -d \
    -e GITHUB_REPO='<your-repository-name>' \
    -p 80:80 \
    zetaplusae/github-prometheus-exporter

By running the command above, an HTTP server will be started on port 80.

curl http://localhost/metrics will output,

# HELP github_assets_download_count Github Assets download count.
# TYPE github_assets_download_count counter
github_assets_download_count{asset_state="uploaded",target_commitish="master",draft="false",release_id="123",uploader="<author>",repo="<your-repository-name>",asset_id="456",content_type="application/x-gzip",tag_name="v1.0",release_name="v1.0",asset_name="foobar-1.0.tar.gz",prerelease="false",} 99

# HELP github_assets_size Github Assets size.
# TYPE github_assets_size gauge
github_assets_size{asset_state="uploaded",target_commitish="master",draft="false",release_id="123",uploader="<author>",repo="<your-repository-name>",asset_id="456",content_type="application/x-gzip",tag_name="v1.0",release_name="v1.0",asset_name="foobar-1.0.tar.gz",prerelease="false",} 99

# HELP github_assets_count Github Assets count.
# TYPE github_assets_count counter
github_assets_count{repo="<your-repository-name>",} 1

# HELP github_repo_stars Github Repository Stars
# TYPE github_repo_stars counter
github_repo_stars{repo="<your-repository-name>",} 99

# HELP github_api_request_duration_seconds Github API Request Duration (sec).
# TYPE github_api_request_duration_seconds gauge
github_api_request_duration_seconds{http_status="200",path="/repos/<your-repository-name>/releases",repo="<your-repository-name>",} 1
github_api_request_duration_seconds{http_status="200",path="/repos/<your-repository-name>/stargazers",repo="<your-repository-name>",} 1

Configuration

This image relies on the following environment variables:

Env NameRequiredHelp
GITHUB_REPOtrueThe name of your Github repository.
(e.g. predatorray/github-prometheus-exporter)
GITHUB_API_SERVERfalseThe URL to the Github API Server.
(Default: https://api.github.com)
GITHUB_USERfalseThe Github user.
(See the Authentication Wiki)
GITHUB_ACCESS_TOKENfalseThe Github access token of the user.
(See the Authentication Wiki)

This project is developed with the help of these two open-sourced project:

Support

You can ask me anything about this project by creating an issue.

Tag summary

Content type

Image

Digest

Size

8.2 MB

Last updated

over 5 years ago

docker pull zetaplusae/github-prometheus-exporter