diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 08:02:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 08:02:46 +0000 |
commit | e4e8d437fe47a4d97ab469fc9116e50ab1601c54 (patch) | |
tree | d573aafc30201b68be84aba1a44a8f5f2fc30d4e /python | |
parent | Adding debian version 3.3.4-1.1. (diff) | |
download | knot-e4e8d437fe47a4d97ab469fc9116e50ab1601c54.tar.xz knot-e4e8d437fe47a4d97ab469fc9116e50ab1601c54.zip |
Merging upstream version 3.3.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'python')
-rwxr-xr-x | python/knot_exporter/knot_exporter/knot_exporter.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/knot_exporter/knot_exporter/knot_exporter.py b/python/knot_exporter/knot_exporter/knot_exporter.py index 32f3339..f106772 100755 --- a/python/knot_exporter/knot_exporter/knot_exporter.py +++ b/python/knot_exporter/knot_exporter/knot_exporter.py @@ -12,6 +12,7 @@ import libknot import libknot.control from prometheus_client.core import REGISTRY +from prometheus_client.core import CounterMetricFamily from prometheus_client.core import GaugeMetricFamily from prometheus_client.exposition import MetricsHandler @@ -71,8 +72,11 @@ class KnotCollector(object): def metric_families_append(family, labels, labels_val, data): m = metric_families.get(family, GaugeMetricFamily(family, '', labels=labels)) + c = metric_families.get(family + '_total', CounterMetricFamily(family, '', labels=labels)) m.add_metric(labels_val, data) + c.add_metric(labels_val, data) metric_families[family] = m + metric_families[family + '_total'] = c if self.collect_meminfo: # Get global metrics. |