Updated README.md and METRICS.md

This commit is contained in:
Aran Wilkinson
2017-05-22 09:42:30 +01:00
parent 6a67bcd04a
commit 515e60ad63
2 changed files with 26 additions and 36 deletions
+18
View File
@@ -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
```
+8 -36
View File
@@ -4,52 +4,24 @@ Exposes metrics of container pulls and stars from the Docker Hub API, to a Prome
## Configuration ## Configuration
The image is setup to take two parameters from environment variables: 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.
* `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` Images you wish to monitor: expected format 'user/image1,user/image2'
* `IMAGES` The images you wish to monitor, expected in the format "user/image1, user/image2". Can be across different dockerhub users. * `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 ## Install and deploy
Run manually from Docker Hub: 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: Build a docker image:
``` ```
docker build -t <image-name> . docker build -t <image-name> .
docker run -d --restart=always -p 9170:9170 -e IMAGES="infinityworks/ranch-eye, infinityworks/prom-conf" <image-name> docker run -d --restart=always -p 9170:9170 <image-name> -listen-address=:9170 -images="infinityworks/ranch-eye,infinityworks/prom-conf" -organisations="infinityworks"
```
## 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
``` ```
## Metadata ## Metadata