diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py index fab95bf843..a7da398467 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/_load.py @@ -145,7 +145,7 @@ def _load_instrumentors(distro): # environment regarding python version, libc, etc... In this case it's better # to skip the single instrumentation rather than failing to load everything # so treat differently ImportError than the rest of exceptions - _logger.exception( + _logger.warning( "Importing of %s failed, skipping it", entry_point.name ) continue diff --git a/opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py b/opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py index c192c819b1..2e211aafde 100644 --- a/opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py +++ b/opentelemetry-instrumentation/tests/auto_instrumentation/test_load.py @@ -376,7 +376,7 @@ def test_load_instrumentors_import_error_does_not_stop_everything( ] ) self.assertEqual(distro_mock.load_instrumentor.call_count, 2) - mock_logger.exception.assert_any_call( + mock_logger.warning.assert_any_call( "Importing of %s failed, skipping it", ep_mock1.name, )