Skip to content

Commit c63dee2

Browse files
authored
If setproctitle not installed - use fallback (#209)
1 parent 4af1466 commit c63dee2

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

instana/meter.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,13 @@ def get_application_name(self):
259259

260260
basename = os.path.basename(sys.argv[0])
261261
if basename == "gunicorn":
262-
# gunicorn renames their processes to pretty things - we use those by default
263-
# gunicorn: master [djface.wsgi]
264-
# gunicorn: worker [djface.wsgi]
265-
app_name = get_proc_cmdline(as_string=True)
266-
267-
if app_name is None:
262+
if 'setproctitle' in sys.modules:
263+
# With the setproctitle package, gunicorn renames their processes
264+
# to pretty things - we use those by default
265+
# gunicorn: master [djface.wsgi]
266+
# gunicorn: worker [djface.wsgi]
267+
app_name = get_proc_cmdline(as_string=True)
268+
else:
268269
app_name = basename
269270
elif "FLASK_APP" in os.environ:
270271
app_name = os.environ["FLASK_APP"]

0 commit comments

Comments
 (0)