Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def new_child(self,
name: OptStr = None,
kind: OptStr = None) -> 'NoopSpan':
context = self._tracer._next_context(self.context)
return NoopSpan(self.tracer, context)
def to_span(self, context: TraceContext) -> SpanAbc:
if not context.sampled:
return NoopSpan(self, context)
record = Record(context, self._local_endpoint)
self._records[context] = record
return Span(self, context, record)
def new_child(self, context: TraceContext) -> SpanAbc:
new_context = self._next_context(context)
if not context.sampled:
return NoopSpan(self, new_context)
return self.to_span(new_context)