Skip to content

Commit abca88c

Browse files
yiyuan-hemxiamxia
andauthored
fix: Change Lambda Resource CFN Primary Id to be Lambda Name (#267)
### *Description of changes:* Quick change updating the Lambda CFN Primary Id to be its function name instead of its function arn. Note: The current logic defaults to assigning `cloudformation_primary_identifier = remote_resource_identifier` if it remains `None` after the branching logic (line 469). https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html ### *Test Plan:* Verified update in generated span attributes. <img width="1512" alt="Screenshot 2024-10-02 at 3 59 15 PM" src="https://github.com/user-attachments/assets/ea9d1812-8536-4d9d-a6ea-cfd1adece2fa"> By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Min Xia <[email protected]>
1 parent a4bcadc commit abca88c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/_aws_metric_attribute_generator.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
AWS_BEDROCK_KNOWLEDGE_BASE_ID,
1313
AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER,
1414
AWS_KINESIS_STREAM_NAME,
15-
AWS_LAMBDA_FUNCTION_ARN,
1615
AWS_LAMBDA_FUNCTION_NAME,
1716
AWS_LAMBDA_RESOURCEMAPPING_ID,
1817
AWS_LOCAL_OPERATION,
@@ -460,7 +459,6 @@ def _set_remote_type_and_identifier(span: ReadableSpan, attributes: BoundedAttri
460459
elif is_key_present(span, AWS_LAMBDA_FUNCTION_NAME):
461460
remote_resource_type = _NORMALIZED_LAMBDA_SERVICE_NAME + "::Function"
462461
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_LAMBDA_FUNCTION_NAME))
463-
cloudformation_primary_identifier = _escape_delimiters(span.attributes.get(AWS_LAMBDA_FUNCTION_ARN))
464462
elif is_db_span(span):
465463
remote_resource_type = _DB_CONNECTION_STRING_TYPE
466464
remote_resource_identifier = _get_db_connection(span)

0 commit comments

Comments
 (0)