This is a simple server that scrapes Docker Hub rate limit stats and exports them via HTTP for Prometheus consumption.
To run it:
./dockerhub_exporter [flags]
Help on flags:
./dockerhub_exporter -help
For more information check the source code documentation.
By default, it will try to use anonymous access to report on rate limits.
If you want to use an authenticated account, you can pass in your username and password using:
dockerhub_exporter -user=<user_name> -pass=<pass_phrase>
To run the Docker Hub exporter as a Docker container, run:
docker run -p 9090:9090 quay.io/jabley/dockerhub_exporter:v0.9.0
go build
go test ./...
The test coverage number is interesting. Since this is (for now) a small service, it flags that all
the func main()
bit which parses command line args isn't tested. But if you look at the report,
all of the service logic has good coverage.
MIT, see LICENSE.