File tree 2 files changed +10
-6
lines changed
opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation
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
7
7
8
8
## [ Unreleased] ( https://github.com/open-telemetry/opentelemetry-python/compare/v1.11.0-0.30b0...HEAD )
9
9
10
+ - Prune autoinstrumentation sitecustomize module directory from PYTHONPATH immediately
11
+ ([ #1066 ] ( https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1066 ) )
12
+
10
13
## [ 1.11.0-0.30b0] ( https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.11.0-0.30b0 ) - 2022-04-18
11
14
12
15
### Fixed
Original file line number Diff line number Diff line change @@ -110,19 +110,20 @@ def _load_configurators():
110
110
111
111
112
112
def 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
+
113
120
try :
114
121
distro = _load_distros ()
115
122
distro .configure ()
116
123
_load_configurators ()
117
124
_load_instrumentors (distro )
118
125
except Exception : # pylint: disable=broad-except
119
126
logger .exception ("Failed to auto initialize opentelemetry" )
120
- finally :
121
- environ ["PYTHONPATH" ] = sub (
122
- rf"{ dirname (abspath (__file__ ))} { pathsep } ?" ,
123
- "" ,
124
- environ ["PYTHONPATH" ],
125
- )
126
127
127
128
128
129
initialize ()
You can’t perform that action at this time.
0 commit comments