From 9ed2d2509ef31ca98b13d0cc00a1176c56c21926 Mon Sep 17 00:00:00 2001 From: Aran Wilkinson Date: Mon, 22 May 2017 09:56:30 +0100 Subject: [PATCH] Updated metrics listen address/port --- Dockerfile | 2 ++ README.md | 10 +++++++--- main.go | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index d08f662..b85ea56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ RUN go get \ FROM alpine +EXPOSE 9171 + RUN addgroup exporter \ && adduser -S -G exporter exporter \ && apk --update --no-cache add ca-certificates diff --git a/README.md b/README.md index 2fb954e..76d1ea4 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Exposes metrics of container pulls and stars from the Docker Hub API, to a Prome 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") +* `listen-address` Address on which to expose metrics and web interface. (default ":9171") * `organisations` Organisations/Users you wish to monitor: expected format 'org1,org2' * `telemetry-path` Path under which to expose metrics. (default "/metrics") @@ -15,14 +15,18 @@ The image is setup to take two parameters via command line flags. Below is a lis Run manually from Docker Hub: ``` -docker run -d --restart=always -p 9170:9170 infinityworks/docker-hub-exporter -listen-address=:9170 -images="infinityworks/ranch-eye,infinityworks/prom-conf" -organisations="infinityworks" +docker run -d --restart=always -p 9171:9171 infinityworks/docker-hub-exporter -listen-address=:9171 -images="infinityworks/ranch-eye,infinityworks/prom-conf" -organisations="infinityworks" ``` Build a docker image: ``` docker build -t . -docker run -d --restart=always -p 9170:9170 -listen-address=:9170 -images="infinityworks/ranch-eye,infinityworks/prom-conf" -organisations="infinityworks" +docker run -d --restart=always -p 9171:9171 -listen-address=:9171 -images="infinityworks/ranch-eye,infinityworks/prom-conf" -organisations="infinityworks" ``` +## Metrics + +Metrics will be made available on port 8080 by default +An example of these metrics can be found in the `METRICS.md` markdown file in the root of this repository ## Metadata [![](https://images.microbadger.com/badges/image/infinityworks/docker-hub-exporter.svg)](http://microbadger.com/images/infinityworks/docker-hub-exporter "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/version/infinityworks/docker-hub-exporter.svg)](http://microbadger.com/images/infinityworks/docker-hub-exporter "Get your own version badge on microbadger.com") diff --git a/main.go b/main.go index ba14fe6..d5a8ca1 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,7 @@ import ( func main() { var ( - listenAddress = flag.String("listen-address", ":8080", "Address on which to expose metrics and web interface.") + listenAddress = flag.String("listen-address", ":9171", "Address on which to expose metrics and web interface.") metricsPath = flag.String("telemetry-path", "/metrics", "Path under which to expose metrics.") organisations = flag.String("organisations", "", "Organisations/Users you wish to monitor: expected format 'org1,org2'") images = flag.String("images", "", "Images you wish to monitor: expected format 'user/image1,user/image2'")