~tomleb/dockerhub-ratelimit-exporter

A prometheus exporter for the new Docker hub rate limits
Fix wrong mailing list link
Add dockerhub_rate_limit_up metrics

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~tomleb/dockerhub-ratelimit-exporter
read/write
git@git.sr.ht:~tomleb/dockerhub-ratelimit-exporter

You can also use your local clone with git send-email.

#DockerHub RateLimit Exporter

Custom prometheus exporter that exposes the current rate limit information from DockerHub.

Both anonymous and authenticated rate limit information is supported. To login, you can either use the -dockerhub-username and -dockerhub-password flags, or use the environment variables DOCKERHUB_USERNAME and DOCKERHUB_PASSWORD.

If you are behind a proxy, you can set the HTTPS_PROXY environment variable to configure the proxy. You can also use the -ca-cert flag to specify the root CA cert.

#Metrics

The following metrics are exposed by this custom exporter.

dockerhub_rate_limit_up

Flag whether the last rate limit request to dockerhub was successful or not (1 = success, 0 = failure)

dockerhub_rate_limit_limit

The maximum number of pull that can be done within the specified interval

dockerhub_rate_limit_remaining

The number of pull remaining before reaching the limit

dockerhub_rate_limit_seconds

The interval in seconds at which the limit applies

#Build

To build, run the following command.

go build

#Usage

Usage of ./dockerhub-ratelimit-exporter:
  -ca-cert string
    	The CA cert to trust when querying docker hub
  -listen-addr string
    	The address the exporter will listen on (default ":8080")
  -password string
    	The Dockerhub password
  -username string
    	The Dockerhub username or user id

#License

See LICENSE.

#Contribution

Patches welcomed at the following mailing list: https://lists.sr.ht/~tomleb/public-inbox.