mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-27 19:25:27 +03:00
Correct issue with long container name (Docker plugin)
This commit is contained in:
parent
2e5114d318
commit
e116ff4d45
@ -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))
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user