From 515e60ad63578a8a37a8f1b818f011c9e911c1db Mon Sep 17 00:00:00 2001 From: Aran Wilkinson Date: Mon, 22 May 2017 09:42:30 +0100 Subject: [PATCH] Updated README.md and METRICS.md --- METRICS.md | 18 ++++++++++++++++++ README.md | 44 ++++++++------------------------------------ 2 files changed, 26 insertions(+), 36 deletions(-) create mode 100644 METRICS.md diff --git a/METRICS.md b/METRICS.md new file mode 100644 index 0000000..0bf60eb --- /dev/null +++ b/METRICS.md @@ -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 +``` \ No newline at end of file diff --git a/README.md b/README.md index 2d694a4..2fb954e 100644 --- a/README.md +++ b/README.md @@ -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 . -docker run -d --restart=always -p 9170:9170 -e IMAGES="infinityworks/ranch-eye, infinityworks/prom-conf" -``` - -## 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 -listen-address=:9170 -images="infinityworks/ranch-eye,infinityworks/prom-conf" -organisations="infinityworks" ``` ## Metadata