From 989abb066a31e03377ff160ead384cc78182e128 Mon Sep 17 00:00:00 2001 From: eliska-n Date: Fri, 25 Aug 2023 11:28:49 +0200 Subject: [PATCH] tags can be None by accident --- asab/metrics/influxdb.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/asab/metrics/influxdb.py b/asab/metrics/influxdb.py index 958b27f2c..c7f4c23e9 100644 --- a/asab/metrics/influxdb.py +++ b/asab/metrics/influxdb.py @@ -220,6 +220,8 @@ def escape_tags(tags: dict): """ clean: dict = {} for k, v in tags.items(): + if v is None: + v = "unknown" clean[k.replace(" ", "\\ ").replace(",", "\\,").replace("=", "\\=")] = v.replace(" ", "\\ ").replace(",", "\\,").replace("=", "\\=") return clean