From a329fd8a4c88e7ee11e0e0f9a9817cd126ec9e50 Mon Sep 17 00:00:00 2001 From: Lukas Hering Date: Wed, 10 Dec 2025 23:52:20 -0500 Subject: [PATCH 1/2] remove unnecessary call to AwsLambdaInstrumentor().instrument() in wrapper script --- python/src/otel/otel_sdk/otel_wrapper.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/python/src/otel/otel_sdk/otel_wrapper.py b/python/src/otel/otel_sdk/otel_wrapper.py index 295410406c..7313a99425 100644 --- a/python/src/otel/otel_sdk/otel_wrapper.py +++ b/python/src/otel/otel_sdk/otel_wrapper.py @@ -48,9 +48,6 @@ def modify_module_name(module_name): class HandlerError(Exception): pass - -AwsLambdaInstrumentor().instrument() - path = os.environ.get("ORIG_HANDLER") if path is None: From 8aa44dd589237eac29440561659b0a233a36aebe Mon Sep 17 00:00:00 2001 From: Lukas Hering Date: Thu, 11 Dec 2025 14:44:45 -0500 Subject: [PATCH 2/2] fix failing unit tests --- python/src/otel/otel_sdk/otel_wrapper.py | 1 - python/src/otel/tests/test_otel.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/otel/otel_sdk/otel_wrapper.py b/python/src/otel/otel_sdk/otel_wrapper.py index 7313a99425..907d5abe02 100644 --- a/python/src/otel/otel_sdk/otel_wrapper.py +++ b/python/src/otel/otel_sdk/otel_wrapper.py @@ -37,7 +37,6 @@ import os from importlib import import_module -from opentelemetry.instrumentation.aws_lambda import AwsLambdaInstrumentor def modify_module_name(module_name): diff --git a/python/src/otel/tests/test_otel.py b/python/src/otel/tests/test_otel.py index c59c99015a..488a08153f 100644 --- a/python/src/otel/tests/test_otel.py +++ b/python/src/otel/tests/test_otel.py @@ -153,6 +153,7 @@ def mock_execute_lambda(event=None): Args: event: The Lambda event which may or may not be used by instrumentation. """ + AwsLambdaInstrumentor().instrument() # The point of the repo is to test using the script, so we can count on it # being here for every test and do not check for its existence.