From 211d20b5b4649552a75376c937cb7aba707c88c0 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Fri, 29 Apr 2022 15:17:53 +0200
Subject: [PATCH] Also add station name to total scraping duration

---
 .../tango-prometheus-exporter/code/tango-prometheus-client.py   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docker-compose/tango-prometheus-exporter/code/tango-prometheus-client.py b/docker-compose/tango-prometheus-exporter/code/tango-prometheus-client.py
index d171d9219..86298311c 100644
--- a/docker-compose/tango-prometheus-exporter/code/tango-prometheus-client.py
+++ b/docker-compose/tango-prometheus-exporter/code/tango-prometheus-client.py
@@ -208,7 +208,7 @@ class CustomCollector(object):
         scrape_end = time.time()
         logger.info(f"Done scraping. Took {scrape_end - scrape_begin} seconds.")
 
-        scraping_metrics.add_metric(["total"], scrape_end - scrape_begin)
+        scraping_metrics.add_metric([self.station, "total"], scrape_end - scrape_begin)
         
         yield attribute_metrics
         yield scraping_metrics
-- 
GitLab