Correct issue with long container name (Docker plugin)

This commit is contained in:
Nicolargo 2015-07-12 16:06:25 +02:00
parent 2e5114d318
commit e116ff4d45
2 changed files with 3 additions and 3 deletions

View File

@ -146,6 +146,7 @@ class Export(GlancesExport):
def export(self, name, columns, points):
"""Write the points to the InfluxDB server."""
logger.debug("Export {} stats to InfluxDB".format(name))
# Manage prefix
if self.prefix is not None:
name = self.prefix + '.' + name
@ -161,5 +162,4 @@ class Export(GlancesExport):
try:
self.client.write_points(data)
except Exception as e:
logger.error("Can not export stats to InfluxDB (%s)" % e)
logger.debug("Export {} stats to InfluxDB".format(name))
logger.error("Can not export {} stats to InfluxDB ({})".format(name, e))

View File

@ -427,7 +427,7 @@ class Plugin(GlancesPlugin):
# Name
name = container['Names'][0]
if len(name) > 20:
name = '_' + name[:-19]
name = '_' + name[-19:]
else:
name = name[:20]
msg = ' {0:20}'.format(name)