Skip to content

Commit

Permalink
log and flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Aug 30, 2024
1 parent 89fe9d7 commit adad083
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wis2box-mqtt-metrics-collector/mqtt_metrics_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit adad083

Please sign in to comment.