File tree 1 file changed +4
-3
lines changed 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 158
158
),
159
159
}
160
160
161
+ _NOT_PATCHABLE_VIA_ENVVAR = {"dd_trace_api" }
162
+
161
163
162
164
class PatchException (Exception ):
163
165
"""Wraps regular `Exception` class when patching modules"""
@@ -212,8 +214,7 @@ def on_import(hook):
212
214
return on_import
213
215
214
216
215
- def patch_all (** patch_modules ):
216
- # type: (bool) -> None
217
+ def patch_all (** patch_modules : bool ) -> None :
217
218
"""Enables ddtrace library instrumentation.
218
219
219
220
In addition to ``patch_modules``, an override can be specified via an
@@ -230,7 +231,7 @@ def patch_all(**patch_modules):
230
231
# The enabled setting can be overridden by environment variables
231
232
for module , _enabled in modules .items ():
232
233
env_var = "DD_TRACE_%s_ENABLED" % module .upper ()
233
- if env_var in os .environ :
234
+ if module not in _NOT_PATCHABLE_VIA_ENVVAR and env_var in os .environ :
234
235
modules [module ] = formats .asbool (os .environ [env_var ])
235
236
236
237
# Enable all dependencies for the module
You can’t perform that action at this time.
0 commit comments