summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/python.d.plugin.in
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/python.d.plugin/python.d.plugin.in')
-rw-r--r--collectors/python.d.plugin/python.d.plugin.in17
1 files changed, 16 insertions, 1 deletions
diff --git a/collectors/python.d.plugin/python.d.plugin.in b/collectors/python.d.plugin/python.d.plugin.in
index c04cb3ff0..681ceb403 100644
--- a/collectors/python.d.plugin/python.d.plugin.in
+++ b/collectors/python.d.plugin/python.d.plugin.in
@@ -131,7 +131,7 @@ def dirs():
DIRS = dirs()
-IS_ATTY = sys.stdout.isatty()
+IS_ATTY = sys.stdout.isatty() or sys.stderr.isatty()
MODULE_SUFFIX = '.chart.py'
@@ -496,7 +496,16 @@ class FileLockRegistry:
self.path = path
self.locks = dict()
+ @staticmethod
+ def rename(name):
+ # go version name is 'docker'
+ if name.startswith("dockerd"):
+ name = "docker" + name[7:]
+ return name
+
+
def register(self, name):
+ name = self.rename(name)
if name in self.locks:
return
file = os.path.join(self.path, '{0}.collector.lock'.format(name))
@@ -505,6 +514,7 @@ class FileLockRegistry:
self.locks[name] = lock
def unregister(self, name):
+ name = self.rename(name)
if name not in self.locks:
return
lock = self.locks[name]
@@ -893,6 +903,11 @@ def main():
registry,
)
+ # cheap attempt to reduce chance of python.d job running before go.d
+ # TODO: better implementation needed
+ if not IS_ATTY:
+ time.sleep(1.5)
+
try:
if not p.setup():
return