Ejemplo n.º 1
0
    def test_uninstrumented_clients_no_longer_trace(self, tracer):
        uninstrument('requests')
        for session in (requests, requests.Session()):
            response = session.get(server)

        assert response.content.decode() == 'hello world\n'
        assert not tracer.finished_spans()
Ejemplo n.º 2
0
    def client_tracing(self, redis_container):
        tracer = MockTracer()
        config.tracer = tracer

        instrument(redis=True)
        try:
            yield tracer
        finally:
            uninstrument('redis')
Ejemplo n.º 3
0
    def session_tracing(self, echo_container):
        tracer = MockTracer()
        config.tracer = tracer
        config.propagate = True
        config.span_tags = dict(custom='tag')

        instrument(requests=True)
        try:
            yield tracer
        finally:
            uninstrument('requests')
Ejemplo n.º 4
0
 def tracer_and_uninstrumented_client(self, request):
     uninstrument('elasticsearch')
     yield request.getfixturevalue(request.param)
Ejemplo n.º 5
0
 def instrumented_elasticsearch(self, tracer):
     elasticsearch_config.prefix = 'MyPrefix'
     yield instrument(tracer, elasticsearch=True)
     uninstrument('elasticsearch')