提交 20f814a0 编写于 作者: N nicolargo

Some FS and LAN metrics fail to export correctly to StatsD (issue #1068)

上级 201d6ddb
......@@ -5,7 +5,10 @@ Glances Version 2
Version 2.9.2
=============
Bugs corrected:
* StatsD export prefix option is ignored (issue #1074)
* Some FS and LAN metrics fail to export correctly to StatsD (issue #1068)
Version 2.9.1
=============
......
......@@ -76,7 +76,18 @@ class Export(GlancesExport):
stat_name = '{}.{}'.format(name, columns[i])
stat_value = points[i]
try:
self.client.gauge(stat_name, stat_value)
self.client.gauge(self._normalize(stat_name),
stat_value)
except Exception as e:
logger.error("Can not export stats to Statsd (%s)" % e)
logger.debug("Export {} stats to Statsd".format(name))
def _normalize(self, name):
"""Normalize name for the Statsd convention"""
# Name should not contain some specials chars (issue #1068)
ret = name.replace(':', '')
ret = ret.replace('%', '')
ret = ret.replace(' ', '_')
return ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册