mirror of
https://github.com/wahyd4/docker-hub-exporter.git
synced 2026-08-08 20:37:12 +10:00
Updated README.md and METRICS.md
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
# Metrics
|
||||
|
||||
Below are an example of the metrics as exposed by this exporter.
|
||||
|
||||
```
|
||||
# HELP docker_hub_image_last_updated last_updated
|
||||
# TYPE docker_hub_image_last_updated gauge
|
||||
docker_hub_image_last_updated{image="prometheus-rancher-exporter",user="infinityworks"} 1472731040.0
|
||||
# HELP docker_hub_image_pulls_total pulls_total
|
||||
# TYPE docker_hub_image_pulls_total counter
|
||||
docker_hub_image_pulls_total{image="prometheus-rancher-exporter",user="infinityworks"} 188672.0
|
||||
# HELP docker_hub_image_stars stars
|
||||
# TYPE docker_hub_image_stars gauge
|
||||
docker_hub_image_stars{image="prometheus-rancher-exporter",user="infinityworks"} 3.0
|
||||
# HELP docker_hub_image_is_automated is_automated
|
||||
# TYPE docker_hub_image_is_automated gauge
|
||||
docker_hub_image_is_automated{image="prometheus-rancher-exporter",user="infinityworks"} 1.0
|
||||
```
|
||||
@@ -4,52 +4,24 @@ Exposes metrics of container pulls and stars from the Docker Hub API, to a Prome
|
||||
|
||||
## Configuration
|
||||
|
||||
The image is setup to take two parameters from environment variables:
|
||||
* `BIND_PORT` The port you wish to run the container on, defaults to 9170
|
||||
* `ORGS` The docker hub organizations you wish to monitor, expected in the format "org1, org2" (Also works for users)
|
||||
* `IMAGES` The images you wish to monitor, expected in the format "user/image1, user/image2". Can be across different dockerhub users.
|
||||
The image is setup to take two parameters via command line flags. Below is a list of available flags. You can also find this list by using the `--help` flag.
|
||||
|
||||
* `images` Images you wish to monitor: expected format 'user/image1,user/image2'
|
||||
* `listen-address` Address on which to expose metrics and web interface. (default ":8080")
|
||||
* `organisations` Organisations/Users you wish to monitor: expected format 'org1,org2'
|
||||
* `telemetry-path` Path under which to expose metrics. (default "/metrics")
|
||||
|
||||
## Install and deploy
|
||||
|
||||
Run manually from Docker Hub:
|
||||
```
|
||||
docker run -d --restart=always -p 9170:9170 -e IMAGES="infinityworks/ranch-eye, infinityworks/prom-conf" -e ORGS="infinityworks" infinityworks/docker-hub-exporter
|
||||
docker run -d --restart=always -p 9170:9170 infinityworks/docker-hub-exporter -listen-address=:9170 -images="infinityworks/ranch-eye,infinityworks/prom-conf" -organisations="infinityworks"
|
||||
```
|
||||
|
||||
Build a docker image:
|
||||
```
|
||||
docker build -t <image-name> .
|
||||
docker run -d --restart=always -p 9170:9170 -e IMAGES="infinityworks/ranch-eye, infinityworks/prom-conf" <image-name>
|
||||
```
|
||||
|
||||
## Docker compose
|
||||
|
||||
```
|
||||
docker-hub-exporter:
|
||||
tty: true
|
||||
stdin_open: true
|
||||
expose:
|
||||
- 9170:9170
|
||||
image: infinityworks/docker-hub-exporter
|
||||
```
|
||||
|
||||
## Metrics
|
||||
|
||||
Metrics will be made available on port 9170 by default
|
||||
|
||||
```
|
||||
# HELP docker_hub_image_last_updated last_updated
|
||||
# TYPE docker_hub_image_last_updated gauge
|
||||
docker_hub_image_last_updated{image="prometheus-rancher-exporter",user="infinityworks"} 1472731040.0
|
||||
# HELP docker_hub_image_pulls_total pulls_total
|
||||
# TYPE docker_hub_image_pulls_total counter
|
||||
docker_hub_image_pulls_total{image="prometheus-rancher-exporter",user="infinityworks"} 188672.0
|
||||
# HELP docker_hub_image_stars stars
|
||||
# TYPE docker_hub_image_stars gauge
|
||||
docker_hub_image_stars{image="prometheus-rancher-exporter",user="infinityworks"} 3.0
|
||||
# HELP docker_hub_image_is_automated is_automated
|
||||
# TYPE docker_hub_image_is_automated gauge
|
||||
docker_hub_image_is_automated{image="prometheus-rancher-exporter",user="infinityworks"} 1.0
|
||||
docker run -d --restart=always -p 9170:9170 <image-name> -listen-address=:9170 -images="infinityworks/ranch-eye,infinityworks/prom-conf" -organisations="infinityworks"
|
||||
```
|
||||
|
||||
## Metadata
|
||||
|
||||
Reference in New Issue
Block a user