How to use the opentelemetry-api.src.opentelemetry.trace.sampling.Decision function in opentelemetry-api

To help you get started, we’ve selected a few opentelemetry-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github open-telemetry / opentelemetry-python / opentelemetry-api / src / opentelemetry / trace / sampling.py View on Github external
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)
github open-telemetry / opentelemetry-python / opentelemetry-api / src / opentelemetry / trace / sampling.py View on Github external
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)

opentelemetry-api

OpenTelemetry Python API

Apache-2.0
Latest version published 1 month ago

Package Health Score

97 / 100
Full package analysis