From adad0831cd41fb2796d2955ce3318c3b0e6c439c Mon Sep 17 00:00:00 2001 From: Maaike Date: Fri, 30 Aug 2024 10:17:02 +0200 Subject: [PATCH] log and flake8 --- wis2box-mqtt-metrics-collector/mqtt_metrics_collector.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wis2box-mqtt-metrics-collector/mqtt_metrics_collector.py b/wis2box-mqtt-metrics-collector/mqtt_metrics_collector.py index 118f23ec..e57c2b5c 100644 --- a/wis2box-mqtt-metrics-collector/mqtt_metrics_collector.py +++ b/wis2box-mqtt-metrics-collector/mqtt_metrics_collector.py @@ -167,8 +167,9 @@ def sub_mqtt_metrics(client, userdata, msg): wsi = 'none' if 'wigos_station_identifier' in m['properties']: wsi = m['properties']['wigos_station_identifier'] - # if label wsi is not present in notify_wsi_total, set it to 0 and sleep 5 seconds before incrementing + # if label wsi is not in notify_wsi_total, set to 0 and sleep 5s if wsi not in notify_wsi_total._metrics: + logger.info(f"new station: {wsi}, sleep 5s before incrementing") notify_wsi_total.labels(wsi).inc(0) failure_wsi_total.labels(wsi).inc(0) station_wsi.labels(wsi).set(1)