20
20
from re import escape , sub
21
21
from typing import Dict , Iterable , Sequence
22
22
23
+ from wrapt import ObjectProxy
24
+
25
+ from opentelemetry import context , trace
26
+
23
27
# pylint: disable=E0611
24
28
# FIXME: fix the importing of these private attributes when the location of the _SUPPRESS_HTTP_INSTRUMENTATION_KEY is defined.=
25
29
from opentelemetry .context import (
26
30
_SUPPRESS_HTTP_INSTRUMENTATION_KEY ,
27
31
_SUPPRESS_INSTRUMENTATION_KEY ,
28
32
)
29
- from wrapt import ObjectProxy
30
-
31
- from opentelemetry import context , trace
32
33
33
34
# pylint: disable=E0611
34
35
from opentelemetry .propagate import extract
@@ -197,10 +198,7 @@ def _initialize(cls):
197
198
if opt_in_list :
198
199
# Process http opt-in
199
200
# http/dup takes priority over http
200
- if (
201
- _OpenTelemetryStabilityMode .HTTP_DUP .value
202
- in opt_in_list
203
- ):
201
+ if _OpenTelemetryStabilityMode .HTTP_DUP .value in opt_in_list :
204
202
http_opt_in = _OpenTelemetryStabilityMode .HTTP_DUP
205
203
elif _OpenTelemetryStabilityMode .HTTP .value in opt_in_list :
206
204
http_opt_in = _OpenTelemetryStabilityMode .HTTP
@@ -226,10 +224,8 @@ def is_instrumentation_enabled() -> bool:
226
224
227
225
228
226
def is_http_instrumentation_enabled () -> bool :
229
- return (
230
- is_instrumentation_enabled ()
231
- and not
232
- context .get_value (_SUPPRESS_HTTP_INSTRUMENTATION_KEY )
227
+ return is_instrumentation_enabled () and not context .get_value (
228
+ _SUPPRESS_HTTP_INSTRUMENTATION_KEY
233
229
)
234
230
235
231
0 commit comments