From cd279c1ec7340e3bafc41252aedef0d768c850e8 Mon Sep 17 00:00:00 2001 From: Edward Marshall Date: Fri, 9 Sep 2016 10:18:15 +0100 Subject: [PATCH] Updated metric names to be compliant with naming guidelines --- README.md | 14 +++++++------- hub_exporter.py | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e47ec16..4783d56 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,13 @@ Metrics will be made available on port 1234 by default ``` # HELP docker_hub_pull_count counter of docker_pulls from the public API -# TYPE docker_hub_pull_count counter -docker_hub_pull_count{image="prometheus",user="prom"} 5360660.0 -docker_hub_pull_count{image="node-exporter",user="prom"} 9668841.0 -# HELP docker_hub_star_count counter of docker_stars from the public API -# TYPE docker_hub_star_count counter -docker_hub_star_count{image="prometheus",user="prom"} 133.0 -docker_hub_star_count{image="node-exporter",user="prom"} 16.0 +# TYPE docker_hub_pull_total counter +docker_hub_pull_total{image="prometheus",user="prom"} 5360660.0 +docker_hub_pull_total{image="node-exporter",user="prom"} 9668841.0 +# HELP docker_hub_star_total counter of docker_stars from the public API +# TYPE docker_hub_star_total counter +docker_hub_star_total{image="prometheus",user="prom"} 133.0 +docker_hub_star_total{image="node-exporter",user="prom"} 16.0 ``` ## Metadata diff --git a/hub_exporter.py b/hub_exporter.py index 788d1d7..53dad56 100644 --- a/hub_exporter.py +++ b/hub_exporter.py @@ -13,8 +13,8 @@ class HubCollector(object): def collect(self): images = os.getenv('IMAGES', default="thebsdbox/ovcli, rucknar/prom-conf").replace(' ','').split(",") print("Starting exporter") - self._pull_metrics = CounterMetricFamily('docker_hub_pull_count', 'counter of docker_pulls from the public API', labels=["image", "user"]) - self._star_metrics = CounterMetricFamily('docker_hub_star_count', 'counter of docker_stars from the public API', labels=["image", "user"]) + self._pull_metrics = CounterMetricFamily('docker_hub_pull_total', 'counter of docker_pulls from the public API', labels=["image", "user"]) + self._star_metrics = CounterMetricFamily('docker_hub_star_total', 'counter of docker_stars from the public API', labels=["image", "user"]) for image in images: print("Getting JSON for " + image)