You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to reproduce
Using opentelemetry-instrument with any exporter or instrumentation which invokes a python subprocess during initialization. For example, the opentelemetry-exporter-gcp-trace exporter may invoke the gcloud (written in python) command in a subprocess to get project information and authentication tokens. The subprocess will then try to autoinstrument, creating a recursive loop of subprocesses being created.
What is the expected behavior?
Auto-instrumentation should not apply to subprocesses created in the initialize() phase of auto-instrumentation. The PYTHONPATH environment variable should have the sitecustomize.py dirname stripped out at the beginning of sitecustomize.py. This would prevent subprocesses from being autoinstrumented during setup, which can cause a loop.
What is the actual behavior? PYTHONPATH is correctly stripped later on to avoid this
Describe your environment
Python3.9, linux.
Steps to reproduce
Using
opentelemetry-instrument
with any exporter or instrumentation which invokes a python subprocess during initialization. For example, theopentelemetry-exporter-gcp-trace
exporter may invoke thegcloud
(written in python) command in a subprocess to get project information and authentication tokens. The subprocess will then try to autoinstrument, creating a recursive loop of subprocesses being created.What is the expected behavior?
Auto-instrumentation should not apply to subprocesses created in the
initialize()
phase of auto-instrumentation. ThePYTHONPATH
environment variable should have thesitecustomize.py
dirname stripped out at the beginning ofsitecustomize.py
. This would prevent subprocesses from being autoinstrumented during setup, which can cause a loop.What is the actual behavior?
PYTHONPATH
is correctly stripped later on to avoid thisopentelemetry-python-contrib/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py
Lines 120 to 125 in e9f83e1
However, any subprocesses created in these lines will cause a loop.
Additional context
I can write a repro if necessary.
The text was updated successfully, but these errors were encountered: