From 5e35db615d9286c8a4611b51fbb926712d134228 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 1 Oct 2020 11:44:08 +0200 Subject: [PATCH] deprecate str --- rspamd_exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rspamd_exporter.py b/rspamd_exporter.py index 23221e8..89f4a75 100644 --- a/rspamd_exporter.py +++ b/rspamd_exporter.py @@ -21,7 +21,7 @@ def json_to_prom(json, prefix, instance): prefix = prefix + "_" + v.index(item) if type(item) is bool: outlines += '{}_{}{{instance="{}"}} {}\n'.format(prefix, k, instance, 1 if item else 0) - if type(item) in [int, str]: + if type(item) in [int, float]: outlines += '{}_{}{{instance="{}"}} {}\n'.format(prefix, k, instance,item) if type(item) is dict: outlines += json_to_prom(item, "{}_{}".format(prefix, k), instance)