Skip to content

Commit cc7d4a1

Browse files
committed
skip
1 parent 14fabd8 commit cc7d4a1

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ddtrace/_trace/provider.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class DefaultContextProvider(BaseContextProvider):
5757
"""
5858

5959
def __init__(self) -> None:
60+
self._otel_enabled = False
6061
super(DefaultContextProvider, self).__init__()
6162

6263
def _has_active_context(self) -> bool:
@@ -76,7 +77,7 @@ def active(self) -> Optional[ActiveTrace]:
7677

7778
# PERF: type(item) is Span is about the same perf as isinstance(item, Span)
7879
# when item is a Span, but slower when item is a Context
79-
if type(item) is Span:
80+
if type(item) is Span and not self._otel_enabled:
8081
return self._update_active(item)
8182
return item
8283

ddtrace/internal/opentelemetry/context.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class DDRuntimeContext:
1414
Responsible for converting between OpenTelemetry and Datadog spans. This class is loaded by entrypoint
1515
when `opentelemetry.context` is imported.
1616
"""
17+
def __init__(self):
18+
self._ddcontext_provider._otel_enabled = True
1719

1820
def attach(self, otel_context):
1921
"""

0 commit comments

Comments
 (0)