mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-03 07:03:40 +03:00
Merge branch 'issue1068' into develop
This commit is contained in:
commit
4a2826669b
3
NEWS
3
NEWS
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user