Skip to content

Commit d5dece2

Browse files
committed
fix: Standardize Lambda Function Name Parameter
1 parent d5e0666 commit d5dece2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/patches/_botocore_patches.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ def _apply_botocore_lambda_patch() -> None:
6262

6363
def patch_extract_attributes(self, attributes: _AttributeMapT):
6464
old_extract_attributes(self, attributes)
65-
function_name = self._call_context.params.get("FunctionName")
66-
if function_name:
65+
# This param can be passed as an arn or a name. We standardize it to be the name.
66+
function_name_param = self._call_context.params.get("FunctionName")
67+
if function_name_param:
68+
function_name = function_name_param
69+
if function_name_param.startswith("arn:aws:lambda:"):
70+
function_name = function_name_param.split(":")[-1]
6771
attributes[AWS_LAMBDA_FUNCTION_NAME] = function_name
6872
resource_mapping_id = self._call_context.params.get("UUID")
6973
if resource_mapping_id:

0 commit comments

Comments
 (0)