Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def should_sample(
self,
parent_context: Optional["SpanContext"],
trace_id: int,
span_id: int,
name: str,
attributes: Optional[Attributes] = None, # TODO
links: Sequence["Link"] = (),
) -> "Decision":
if parent_context is not None:
return Decision(parent_context.trace_options.sampled)
return Decision(trace_id & self.CHECK_BYTES < self.bound)
def should_sample(
self,
parent_context: Optional["SpanContext"],
trace_id: int,
span_id: int,
name: str,
attributes: Optional[Attributes] = None, # TODO
links: Sequence["Link"] = (),
) -> "Decision":
if parent_context is not None:
return Decision(parent_context.trace_options.sampled)
return Decision(trace_id & self.CHECK_BYTES < self.bound)