diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py index 912675f1b7..68ef972d02 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py @@ -29,7 +29,7 @@ def initialize(): # prevents auto-instrumentation of subprocesses if code execs another python process environ["PYTHONPATH"] = _python_path_without_directory( - environ["PYTHONPATH"], dirname(abspath(__file__)), pathsep + environ.get("PYTHONPATH", ""), dirname(abspath(__file__)), pathsep ) try: