summaryrefslogtreecommitdiff
path: root/overlays/zte-prometheus-exporter
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-12-29 21:24:49 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2021-12-29 21:24:49 +0100
commit0c9e777f17d17d55693aa500ebb76a65987fde45 (patch)
tree999bc0d9b6247884573aadac417b5c2b9c5d044a /overlays/zte-prometheus-exporter
parent00c3dc8e08938c608f0b60bfb7db17d2617421ef (diff)
downloadnixos-0c9e777f17d17d55693aa500ebb76a65987fde45.tar
nixos-0c9e777f17d17d55693aa500ebb76a65987fde45.tar.gz
nixos-0c9e777f17d17d55693aa500ebb76a65987fde45.tar.bz2
nixos-0c9e777f17d17d55693aa500ebb76a65987fde45.tar.xz
nixos-0c9e777f17d17d55693aa500ebb76a65987fde45.zip
zte-prometheus-exporter: ...
Diffstat (limited to 'overlays/zte-prometheus-exporter')
-rw-r--r--overlays/zte-prometheus-exporter/zte-prometheus-exporter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/overlays/zte-prometheus-exporter/zte-prometheus-exporter.py b/overlays/zte-prometheus-exporter/zte-prometheus-exporter.py
index 13ff5a85..67f13716 100644
--- a/overlays/zte-prometheus-exporter/zte-prometheus-exporter.py
+++ b/overlays/zte-prometheus-exporter/zte-prometheus-exporter.py
@@ -163,7 +163,7 @@ class ZTEMetrics:
163 link_metrics['dsl_uptime_seconds']['metrics'] += [({"link": link_number}, int(self.attrs['DSLINTERFACE'][link]['Showtime_start']))] 163 link_metrics['dsl_uptime_seconds']['metrics'] += [({"link": link_number}, int(self.attrs['DSLINTERFACE'][link]['Showtime_start']))]
164 if link_metrics: 164 if link_metrics:
165 for metric_name in link_metrics: 165 for metric_name in link_metrics:
166 metrics += _format_prom_metrics('dsl_{metric_name}', link_metrics[metric_name]['type'], link_metrics[metric_name]['metrics']) 166 metrics += _format_prom_metrics(f'dsl_{metric_name}', link_metrics[metric_name]['type'], link_metrics[metric_name]['metrics'])
167 167
168 eth_metrics = dict() 168 eth_metrics = dict()
169 for link in self.attrs['ETH']: 169 for link in self.attrs['ETH']:
@@ -178,7 +178,7 @@ class ZTEMetrics:
178 eth_metrics['sent_bytes']['metrics'] += [({"link": link_number}, int(self.attrs['ETH'][link]['BytesSent']))] 178 eth_metrics['sent_bytes']['metrics'] += [({"link": link_number}, int(self.attrs['ETH'][link]['BytesSent']))]
179 if eth_metrics: 179 if eth_metrics:
180 for metric_name in eth_metrics: 180 for metric_name in eth_metrics:
181 metrics += _format_prom_metrics('eth_{metric_name}', eth_metrics[metric_name]['type'], eth_metrics[metric_name]['metrics']) 181 metrics += _format_prom_metrics(f'eth_{metric_name}', eth_metrics[metric_name]['type'], eth_metrics[metric_name]['metrics'])
182 182
183 return metrics.encode('utf-8') 183 return metrics.encode('utf-8')
184 184