Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0afd484

Browse files
author
Alex Boten
committed
don't need CURRENT_SPAN in the DefaultTracer
Signed-off-by: Alex Boten <[email protected]>
1 parent ae2b960 commit 0afd484

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

opentelemetry-api/src/opentelemetry/trace/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -538,18 +538,14 @@ class DefaultTracer(Tracer):
538538
All operations are no-op.
539539
"""
540540

541-
# Constant used to represent the current span being used as a parent.
542-
# This is the default behavior when creating spans.
543-
CURRENT_SPAN = DefaultSpan(INVALID_SPAN_CONTEXT)
544-
545541
def get_current_span(self) -> "Span":
546542
# pylint: disable=no-self-use
547543
return INVALID_SPAN
548544

549545
def start_span(
550546
self,
551547
name: str,
552-
parent: ParentSpan = CURRENT_SPAN,
548+
parent: ParentSpan = Tracer.CURRENT_SPAN,
553549
kind: SpanKind = SpanKind.INTERNAL,
554550
attributes: typing.Optional[types.Attributes] = None,
555551
links: typing.Sequence[Link] = (),
@@ -562,7 +558,7 @@ def start_span(
562558
def start_as_current_span(
563559
self,
564560
name: str,
565-
parent: ParentSpan = CURRENT_SPAN,
561+
parent: ParentSpan = Tracer.CURRENT_SPAN,
566562
kind: SpanKind = SpanKind.INTERNAL,
567563
attributes: typing.Optional[types.Attributes] = None,
568564
links: typing.Sequence[Link] = (),

0 commit comments

Comments
 (0)