Prometheus exporter for Docker Hub statistics
1.5K
A small Go application to periodically pull statistics and metrics from Docker Hub, and expose them in a Prometheus-compatible format.
You can easily run the application from its Docker image:
$ docker run --rm -it -p 8080:8080 rycus86/dockerhub-exporter <flags>
The command line parameters are like this:
Usage of /exporter:
-interval duration
Interval between checks (default 1h0m0s)
-owner value
Owners (namespaces) to list repositories for (multiple values are allowed)
-port int
The HTTP port to listen on (default 8080)
-timeout duration
HTTP API call timeout (default 15s)
The Docker image reference points to a multi-arch manifest, with the actual images being available for the amd64, armhf and arm64v8 platforms.
You can specify the Docker Hub owners (namespaces) to list repositories from multiple times:
$ docker run --rm -it -p 8080:8080 rycus86/dockerhub-exporter \
-owner one -owner two -owner three
The following metrics are exposed on the /metrics endpoint:
$ curl -s http://localhost:8080/metrics | grep dockerhub_
# HELP dockerhub_pull_count Number of Pulls
# TYPE dockerhub_pull_count gauge
dockerhub_pull_count{owner="rycus86",repository="podlike"} 2379
dockerhub_pull_count{owner="rycus86",repository="prometheus"} 339913
dockerhub_pull_count{owner="rycus86",repository="prometheus-node-exporter"} 89127
# HELP dockerhub_repo_count Number of Repositories
# TYPE dockerhub_repo_count gauge
dockerhub_repo_count{owner="rycus86"} 38
# HELP dockerhub_star_count Number of Stars
# TYPE dockerhub_star_count gauge
dockerhub_star_count{owner="rycus86",repository="podlike"} 0
dockerhub_star_count{owner="rycus86",repository="prometheus"} 2
dockerhub_star_count{owner="rycus86",repository="prometheus-node-exporter"} 1
MIT
Content type
Image
Digest
Size
3.5 MB
Last updated
about 8 years ago
docker pull rycus86/dockerhub-exporter