|
23 | 23 | from skywalking import sampling |
24 | 24 | from skywalking.trace import ID |
25 | 25 | from skywalking.trace.carrier import Carrier |
26 | | -from skywalking.trace.segment import Segment, SegmentRef |
| 26 | +from skywalking.trace.segment import NoopSegment, Segment, SegmentRef |
27 | 27 | from skywalking.trace.snapshot import Snapshot |
28 | 28 | from skywalking.trace.span import Span, Kind, NoopSpan, EntrySpan, ExitSpan |
29 | 29 | from skywalking.utils.counter import Counter |
@@ -95,7 +95,7 @@ def get_name(self): |
95 | 95 |
|
96 | 96 | class SpanContext: |
97 | 97 | def __init__(self): |
98 | | - self.segment: Segment = Segment() |
| 98 | + self.segment = Segment() |
99 | 99 | self._sid: Counter = Counter() |
100 | 100 | self._correlation: dict = {} |
101 | 101 | self._nspans: int = 0 |
@@ -285,7 +285,13 @@ def continued(self, snapshot: 'Snapshot'): |
285 | 285 |
|
286 | 286 | class NoopContext(SpanContext): |
287 | 287 | def __init__(self): |
288 | | - super().__init__() |
| 288 | + self.segment = NoopSegment() |
| 289 | + self._sid: Counter = Counter() |
| 290 | + self._correlation: dict = {} |
| 291 | + self._nspans: int = 0 |
| 292 | + self.profile_status: Optional[ProfileStatusReference] = None |
| 293 | + self.create_time = 0 |
| 294 | + self.primary_endpoint: Optional[PrimaryEndpoint] = None |
289 | 295 |
|
290 | 296 | def new_local_span(self, op: str) -> Span: |
291 | 297 | return NoopSpan(self) |
|
0 commit comments