From 3bf578c90c47dd32055c3d7f80f670d8d9d2a65c Mon Sep 17 00:00:00 2001 From: Michael He <53622546+yiyuan-he@users.noreply.github.com> Date: Mon, 14 Oct 2024 11:58:42 -0700 Subject: [PATCH 1/3] Remove Lambda:Function:Name resource type support (#280) (#281) *Description of changes:* Remove `RemoteResourceTargetIdentifier` attribute which will treat Lambda Function as a regular AWS resource. It may conflict with the current concept that have Lambda function defined as a service. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. *Issue #, if available:* *Description of changes:* 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 --- .../distro/_aws_metric_attribute_generator.py | 4 ---- .../distro/test_aws_metric_attribute_generator.py | 14 ++++---------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/_aws_metric_attribute_generator.py b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/_aws_metric_attribute_generator.py index 4e7eb8be0..1493c1c2a 100644 --- a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/_aws_metric_attribute_generator.py +++ b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/_aws_metric_attribute_generator.py @@ -13,7 +13,6 @@ AWS_BEDROCK_KNOWLEDGE_BASE_ID, AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER, AWS_KINESIS_STREAM_NAME, - AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_RESOURCEMAPPING_ID, AWS_LOCAL_OPERATION, AWS_LOCAL_SERVICE, @@ -458,9 +457,6 @@ def _set_remote_type_and_identifier(span: ReadableSpan, attributes: BoundedAttri elif is_key_present(span, AWS_LAMBDA_RESOURCEMAPPING_ID): remote_resource_type = _NORMALIZED_LAMBDA_SERVICE_NAME + "::EventSourceMapping" remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_LAMBDA_RESOURCEMAPPING_ID)) - elif is_key_present(span, AWS_LAMBDA_FUNCTION_NAME): - remote_resource_type = _NORMALIZED_LAMBDA_SERVICE_NAME + "::Function" - remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_LAMBDA_FUNCTION_NAME)) elif is_db_span(span): remote_resource_type = _DB_CONNECTION_STRING_TYPE remote_resource_identifier = _get_db_connection(span) diff --git a/aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_metric_attribute_generator.py b/aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_metric_attribute_generator.py index f9da8bb9a..9cc625d46 100644 --- a/aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_metric_attribute_generator.py +++ b/aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_metric_attribute_generator.py @@ -14,7 +14,6 @@ AWS_BEDROCK_KNOWLEDGE_BASE_ID, AWS_CONSUMER_PARENT_SPAN_KIND, AWS_KINESIS_STREAM_NAME, - AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_RESOURCEMAPPING_ID, AWS_LOCAL_OPERATION, AWS_LOCAL_SERVICE, @@ -1137,26 +1136,21 @@ def test_sdk_client_span_with_remote_resource_attributes(self): self._validate_remote_resource_attributes("AWS::StepFunctions::Activity", "testActivity") self._mock_attribute([AWS_STEPFUNCTIONS_ACTIVITY_ARN], [None]) - # Validate behaviour of AWS_LAMBDA_FUNCTION_NAME attribute, then remove it. - self._mock_attribute([AWS_LAMBDA_FUNCTION_NAME], ["aws_lambda_function_name"], keys, values) - self._validate_remote_resource_attributes("AWS::Lambda::Function", "aws_lambda_function_name") - self._mock_attribute([AWS_LAMBDA_FUNCTION_NAME], [None]) - # Validate behaviour of AWS_LAMBDA_RESOURCEMAPPING_ID attribute, then remove it. self._mock_attribute([AWS_LAMBDA_RESOURCEMAPPING_ID], ["aws_event_source_mapping_id"], keys, values) self._validate_remote_resource_attributes("AWS::Lambda::EventSourceMapping", "aws_event_source_mapping_id") self._mock_attribute([AWS_LAMBDA_RESOURCEMAPPING_ID], [None]) - # Validate behaviour of both AWS_LAMBDA_FUNCTION_NAME and AWS_LAMBDA_RESOURCE_MAPPING_ID, + # Validate behaviour of AWS_LAMBDA_RESOURCE_MAPPING_ID, # then remove it. self._mock_attribute( - [AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_RESOURCEMAPPING_ID], - ["aws_lambda_function_name", "aws_event_source_mapping_id"], + [AWS_LAMBDA_RESOURCEMAPPING_ID], + ["aws_event_source_mapping_id"], keys, values, ) self._validate_remote_resource_attributes("AWS::Lambda::EventSourceMapping", "aws_event_source_mapping_id") - self._mock_attribute([AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_RESOURCEMAPPING_ID], [None, None]) + self._mock_attribute([AWS_LAMBDA_RESOURCEMAPPING_ID], [None]) self._mock_attribute([SpanAttributes.RPC_SYSTEM], [None]) From 6f7b362e06f8f18caab3e8a35904524a5c82913c Mon Sep 17 00:00:00 2001 From: aws-application-signals-bot <167233089+aws-application-signals-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:49:35 -0700 Subject: [PATCH 2/3] Pre-release: Update version to 0.6.0 (#279) This PR updates the version to 0.6.0. 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: github-actions Co-authored-by: Michael He <53622546+yiyuan-he@users.noreply.github.com> --- .../src/amazon/opentelemetry/distro/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py index 77171f446..d0032de6d 100644 --- a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py +++ b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py @@ -1,4 +1,4 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "0.5.0.dev0" +__version__ = "0.6.0" From 259a1d4bb4f93af9d72d859799640ae771f6bda0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 16 Oct 2024 19:12:35 +0000 Subject: [PATCH 3/3] Prepare main for next development cycle: Update version to 0.6.0.dev0 --- .github/workflows/daily_scan.yml | 4 ++-- .../src/amazon/opentelemetry/distro/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/daily_scan.yml b/.github/workflows/daily_scan.yml index 7e9a92756..3e5da2bcd 100644 --- a/.github/workflows/daily_scan.yml +++ b/.github/workflows/daily_scan.yml @@ -82,7 +82,7 @@ jobs: id: high_scan uses: ./.github/actions/image_scan with: - image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-python:v0.5.0" + image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-python:v0.6.0" severity: 'CRITICAL,HIGH' - name: Perform low image scan @@ -90,7 +90,7 @@ jobs: id: low_scan uses: ./.github/actions/image_scan with: - image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-python:v0.5.0" + image-ref: "public.ecr.aws/aws-observability/adot-autoinstrumentation-python:v0.6.0" severity: 'MEDIUM,LOW,UNKNOWN' - name: Configure AWS Credentials for emitting metrics diff --git a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py index d0032de6d..59258f37a 100644 --- a/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py +++ b/aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py @@ -1,4 +1,4 @@ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 -__version__ = "0.6.0" +__version__ = "0.6.0.dev0"