Docker Hub Pull Rate Limits Prometheus exporter

Exposes metrics of rate limits and rate remaining pulls from the Docker Hub API, to a Prometheus compatible endpoint. The exporter uses the anonymous user to determine the rate limit.

Configuration

Run locally

go run main.go

Build a docker image

docker build -t ratelimit-exporter . && docker run -it -p 8080:8080 ratelimit-exporter

Metrics

Metrics will be made available on port 8080 by default. Below is an example of the metrics as exposed by this exporter.

# HELP dockerhub_ratelimit_rate_limit Dockerhub Rate Limit
# TYPE dockerhub_ratelimit_rate_limit gauge
dockerhub_ratelimit_rate_limit 100
# HELP dockerhub_ratelimit_rate_remaining Dockerhub Rate Remaining
# TYPE dockerhub_ratelimit_rate_remaining gauge
dockerhub_ratelimit_rate_remaining 92
# HELP dockerhub_ratelimit_rate_interval Dockerhub Rate Interval
# TYPE dockerhub_ratelimit_rate_interval gauge
dockerhub_ratelimit_rate_interval 21600