Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)