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()
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()
def tearDown(self): HttpClientInstrumentor().uninstrument() self.server.shutdown() self.server_thread.join() super().tearDown()
def setUp(self): super().setUp() HttpClientInstrumentor().instrument() self.server_thread, self.server = self.run_server()
def tearDown(self): super().tearDown() HttpClientInstrumentor().uninstrument() URLLib3Instrumentor().uninstrument()
def tearDown(self): super().tearDown() HttpClientInstrumentor().uninstrument() RequestsInstrumentor().uninstrument()