Skip to content

Conversation

zzhlogin
Copy link
Contributor

@zzhlogin zzhlogin commented Jun 14, 2024

Extend Lambda Support with the following change:

  1. Modify patch _LambdaExtension where extract FunctionName and UUID(event resource mapping ID) and add into "aws.lambda.function_name" and "aws.lambda.resource_mapping_id" span attributes. The attributes only exist in request context so we only modify extract_attributes function.

Note: The upstream already have logic adds FunctionName into SpanAttributes.FAAS_INVOKED_NAME for Invoke operation only. In this PR, we want to extract FunctionName from as many API as we can, but it feels like SpanAttributes.FAAS_INVOKED_NAME is not appropriate to be used as span attribute key for all operations, we define "aws.lambda.function_name" separately, and use it for remoteResourceIdentifier.

  1. Populate RemoteResourceType and RemoteResourceIdentifier for Lambda in ADOT python and update unit test and contract test to verify ADOT python performance.

There is only one API (UpdateEventSourceMappingRequest) have both FunctionName and UUID attributes, we use UUID for it so when adding remoteResourceIdentifier, we set "aws.lambda.resource_mapping_id" with higher priority.

Testing:
A manually E2E test is performed, and confirmed the expected traces metrics and service maps are generated:

Trace:
Screenshot 2024-06-14 at 11 41 00 AM
Screenshot 2024-06-14 at 11 41 31 AM

Metrics:

Screenshot 2024-06-14 at 11 42 37 AM

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@zzhlogin zzhlogin requested a review from a team as a code owner June 14, 2024 19:31
@zzhlogin zzhlogin changed the title Add Lambda support.(NOT READY) Add Lambda support. Jun 14, 2024
@thpierce
Copy link
Contributor

Very outdated, resolve.

@thpierce thpierce closed this Aug 12, 2025
@thpierce thpierce deleted the enhance_lambda branch August 12, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants