From 1de5fdd8e852076be81b81a46d023a1639e8eef5 Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi Date: Tue, 28 Mar 2017 09:46:29 +0200 Subject: [PATCH] Fixed collectd stats (was allowing too long strings) --- c2cwsgiutils/stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/c2cwsgiutils/stats.py b/c2cwsgiutils/stats.py index efd4afe9e..8549bebac 100644 --- a/c2cwsgiutils/stats.py +++ b/c2cwsgiutils/stats.py @@ -128,7 +128,7 @@ def get_stats(self, request): return {"timers": timers, "gauges": gauges, "counters": counters} -INVALID_KEY_CHARS = re.compile(r"[:|\. ]") +INVALID_KEY_CHARS = re.compile(r"[:|\.]") class _StatsDBackend(object): # pragma: nocover @@ -148,7 +148,7 @@ def __init__(self, address, prefix): self._socket.connect(sockaddr) def _key(self, key): - return (self._prefix + ".".join([INVALID_KEY_CHARS.sub("_", i) for i in key]))[:500] + return (self._prefix + ".".join([INVALID_KEY_CHARS.sub("_", i) for i in key]))[:450] def _send(self, message): try: