Beispiel #1
0
    def test_uninstrument(self):
        HttpClientInstrumentor().uninstrument()

        tracer = trace.get_tracer(__name__)
        with tracer.start_as_current_span(
            "HTTP GET"
        ) as span, set_ip_on_next_http_connection(span):
            body = self.perform_request()[1]
        self.assertEqual(b"Hello!", body)

        # We should have a span, but it should have no attributes
        self.assertFalse(self.assert_span(num_spans=1).attributes)

        # instrument again to avoid warning message on tearDown
        HttpClientInstrumentor().instrument()
Beispiel #2
0
 def setUp(self):
     super().setUp()
     self.assert_ip = self.server.server_address[0]
     self.http_host = ":".join(map(str, self.server.server_address[:2]))
     self.http_url_base = "http://" + self.http_host
     self.http_url = self.http_url_base + "/status/200"
     HttpClientInstrumentor().instrument()
     URLLib3Instrumentor().instrument()
Beispiel #3
0
 def tearDown(self):
     HttpClientInstrumentor().uninstrument()
     self.server.shutdown()
     self.server_thread.join()
     super().tearDown()
Beispiel #4
0
 def setUp(self):
     super().setUp()
     HttpClientInstrumentor().instrument()
     self.server_thread, self.server = self.run_server()
Beispiel #5
0
 def tearDown(self):
     super().tearDown()
     HttpClientInstrumentor().uninstrument()
     URLLib3Instrumentor().uninstrument()
Beispiel #6
0
 def tearDown(self):
     super().tearDown()
     HttpClientInstrumentor().uninstrument()
     RequestsInstrumentor().uninstrument()