mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-29 04:04:03 +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):
|
def export(self, name, columns, points):
|
||||||
"""Write the points to the InfluxDB server."""
|
"""Write the points to the InfluxDB server."""
|
||||||
|
logger.debug("Export {} stats to InfluxDB".format(name))
|
||||||
# Manage prefix
|
# Manage prefix
|
||||||
if self.prefix is not None:
|
if self.prefix is not None:
|
||||||
name = self.prefix + '.' + name
|
name = self.prefix + '.' + name
|
||||||
@ -161,5 +162,4 @@ class Export(GlancesExport):
|
|||||||
try:
|
try:
|
||||||
self.client.write_points(data)
|
self.client.write_points(data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Can not export stats to InfluxDB (%s)" % e)
|
logger.error("Can not export {} stats to InfluxDB ({})".format(name, e))
|
||||||
logger.debug("Export {} stats to InfluxDB".format(name))
|
|
||||||
|
@ -427,7 +427,7 @@ class Plugin(GlancesPlugin):
|
|||||||
# Name
|
# Name
|
||||||
name = container['Names'][0]
|
name = container['Names'][0]
|
||||||
if len(name) > 20:
|
if len(name) > 20:
|
||||||
name = '_' + name[:-19]
|
name = '_' + name[-19:]
|
||||||
else:
|
else:
|
||||||
name = name[:20]
|
name = name[:20]
|
||||||
msg = ' {0:20}'.format(name)
|
msg = ' {0:20}'.format(name)
|
||||||
|
Loading…
Reference in New Issue
Block a user