Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extend Lambda Support with the following change:
_LambdaExtension
where extractFunctionName
andUUID
(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 modifyextract_attributes
function.Note: The upstream already have logic adds
FunctionName
intoSpanAttributes.FAAS_INVOKED_NAME
for Invoke operation only. In this PR, we want to extractFunctionName
from as many API as we can, but it feels likeSpanAttributes.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 forremoteResourceIdentifier
.RemoteResourceType
andRemoteResourceIdentifier
for Lambda in ADOT python and update unit test and contract test to verify ADOT python performance.There is only one API (
UpdateEventSourceMappingRequest
) have bothFunctionName
andUUID
attributes, we useUUID
for it so when addingremoteResourceIdentifier
, 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:
Metrics:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.