firewall/mktxp colllectors, fixes/optimizations

This commit is contained in:
Arseniy Kuznetsov
2021-01-24 09:19:31 +01:00
parent 31d0464eb2
commit 158b424e09
24 changed files with 538 additions and 404 deletions

View File

@@ -40,8 +40,9 @@ class BaseCollector:
return collector
@staticmethod
def gauge_collector(name, decription, router_records, metric_key, metric_labels=[]):
BaseCollector._add_id_labels(metric_labels)
def gauge_collector(name, decription, router_records, metric_key, metric_labels=[], add_id_labels = True):
if add_id_labels:
BaseCollector._add_id_labels(metric_labels)
collector = GaugeMetricFamily(f'mktxp_{name}', decription, labels=metric_labels)
for router_record in router_records: