summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/python.d.plugin.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-30 18:47:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-30 18:47:00 +0000
commit03bf87dcb06f7021bfb2df2fa8691593c6148aff (patch)
treee16b06711a2ed77cafb4b7754be0220c3d14a9d7 /collectors/python.d.plugin/python.d.plugin.in
parentAdding upstream version 1.36.1. (diff)
downloadnetdata-03bf87dcb06f7021bfb2df2fa8691593c6148aff.tar.xz
netdata-03bf87dcb06f7021bfb2df2fa8691593c6148aff.zip
Adding upstream version 1.37.0.upstream/1.37.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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