File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased] ( https://github.com/open-telemetry/opentelemetry-python/compare/v1.11.0-0.30b0...HEAD )
99
10+ - Prune autoinstrumentation sitecustomize module directory from PYTHONPATH immediately
11+ ([ #1066 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1066 ) )
12+
1013## [ 1.11.0-0.30b0] ( https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.11.0-0.30b0 ) - 2022-04-18
1114
1215### Fixed
Original file line number Diff line number Diff line change @@ -110,19 +110,20 @@ def _load_configurators():
110110
111111
112112def initialize ():
113+ # prevents auto-instrumentation of subprocesses if code execs another python process
114+ environ ["PYTHONPATH" ] = sub (
115+ rf"{ dirname (abspath (__file__ ))} { pathsep } ?" ,
116+ "" ,
117+ environ ["PYTHONPATH" ],
118+ )
119+
113120 try :
114121 distro = _load_distros ()
115122 distro .configure ()
116123 _load_configurators ()
117124 _load_instrumentors (distro )
118125 except Exception : # pylint: disable=broad-except
119126 logger .exception ("Failed to auto initialize opentelemetry" )
120- finally :
121- environ ["PYTHONPATH" ] = sub (
122- rf"{ dirname (abspath (__file__ ))} { pathsep } ?" ,
123- "" ,
124- environ ["PYTHONPATH" ],
125- )
126127
127128
128129initialize ()
You can’t perform that action at this time.
0 commit comments