How to use the basictracer.Sampler function in basictracer

To help you get started, we’ve selected a few basictracer 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 instana / python-sensor / instana / recorder.py View on Github external
"""
        Convert the passed BasicSpan and add it to the span queue
        """
        source = self.agent.get_from_structure()
        service_name = self.agent.options.service_name

        if span.operation_name in self.REGISTERED_SPANS:
            json_span = RegisteredSpan(span, source, service_name)
        else:
            json_span = SDKSpan(span, source, service_name)

        # logger.debug("Recorded span: %s", json_span)
        self.agent.collector.span_queue.put(json_span)


class InstanaSampler(Sampler):
    def sampled(self, _):
        return False