We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb8e456 commit 4aaadf8Copy full SHA for 4aaadf8
instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py
@@ -440,6 +440,18 @@ def test_uninstrument_after_instrument(self):
440
spans = self.memory_exporter.get_finished_spans()
441
self.assertEqual(len(spans), 3)
442
443
+ def test_no_op_tracer_provider(self):
444
+ self._instrumentor.uninstrument()
445
+ self._instrumentor.instrument(
446
+ tracer_provider=trace.NoOpTracerProvider()
447
+ )
448
+
449
+ app = self._create_fastapi_app()
450
+ client = TestClient(app)
451
+ client.get("/foobar")
452
+ spans = self.memory_exporter.get_finished_spans()
453
+ self.assertEqual(len(spans), 0)
454
455
def tearDown(self):
456
self._instrumentor.uninstrument()
457
super().tearDown()
0 commit comments