From f10916743c2734741e1bc78983a9aa0b6a95980e Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 3 Aug 2021 16:19:41 +0100 Subject: [PATCH] Update the metrics to use labels instead of individual metric names --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 3f3a441..50a786b 100644 --- a/main.py +++ b/main.py @@ -37,8 +37,9 @@ def metrics(): for generation in latest_data['data'][0]['generationmix']: ret_data.append( { - 'key': f'sensor_carbon_generation_{generation["fuel"]}_perc', + 'key': f'sensor_carbon_generation_perc', 'labels': { + 'fuel': generation['fuel'], 'region': latest_data['dnoregion'], }, 'type': 'gauge',