Skip to content

Commit 5d8bb0d

Browse files
committed
Removed aws.lambda.function.arn and aws.lambda.function.name.
1 parent 0111a7e commit 5d8bb0d

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/lmbd.py

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import inspect
1717
import json
1818
import re
19-
from typing import Dict, Final
19+
from typing import Dict
2020

2121
from opentelemetry.instrumentation.botocore.extensions.types import (
2222
_AttributeMapT,
@@ -32,11 +32,6 @@
3232
from opentelemetry.semconv.trace import SpanAttributes
3333
from opentelemetry.trace.span import Span
3434

35-
# Work is underway to add these two keys to the SemConv AWS registry, in line with other AWS resources.
36-
# https://github.com/open-telemetry/semantic-conventions/blob/main/docs/registry/attributes/aws.md#amazon-lambda-attributes
37-
AWS_LAMBDA_FUNCTION_ARN: Final = "aws.lambda.function.arn"
38-
AWS_LAMBDA_FUNCTION_NAME: Final = "aws.lambda.function.name"
39-
4035

4136
class _LambdaOperation(abc.ABC):
4237
@classmethod
@@ -128,9 +123,6 @@ def __init__(self, call_context: _AwsSdkCallContext):
128123
self._op = _OPERATION_MAPPING.get(call_context.operation)
129124

130125
def extract_attributes(self, attributes: _AttributeMapT):
131-
function_name = _OpInvoke._parse_function_name(self._call_context)
132-
if function_name:
133-
attributes[AWS_LAMBDA_FUNCTION_NAME] = function_name
134126
resource_mapping_id = self._call_context.params.get("UUID")
135127
if resource_mapping_id:
136128
attributes[AWS_LAMBDA_RESOURCE_MAPPING_ID] = resource_mapping_id
@@ -159,8 +151,3 @@ def on_success(
159151
span.set_attribute(
160152
AWS_LAMBDA_RESOURCE_MAPPING_ID, resource_mapping_id
161153
)
162-
163-
lambda_configuration = result.get("Configuration", {})
164-
function_arn = lambda_configuration.get("FunctionArn")
165-
if function_arn:
166-
span.set_attribute(AWS_LAMBDA_FUNCTION_ARN, function_arn)

instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_lambda.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import json
1717
import sys
1818
import zipfile
19-
from typing import Final
2019
from unittest import mock
2120

2221
import botocore.session
@@ -36,9 +35,6 @@
3635
from opentelemetry.test.test_base import TestBase
3736
from opentelemetry.trace.span import Span
3837

39-
AWS_LAMBDA_FUNCTION_ARN: Final = "aws.lambda.function.arn"
40-
AWS_LAMBDA_FUNCTION_NAME: Final = "aws.lambda.function.name"
41-
4238

4339
def get_as_zip_file(file_name, content):
4440
zip_output = io.BytesIO()
@@ -220,14 +216,7 @@ def test_get_function(self):
220216
self.assertEqual(
221217
"GetFunction", span.attributes[SpanAttributes.RPC_METHOD]
222218
)
223-
self.assertEqual(
224-
"lambda-function-name-foo",
225-
span.attributes[AWS_LAMBDA_FUNCTION_NAME],
226-
)
227219

228-
function_arn = span.attributes.get(AWS_LAMBDA_FUNCTION_ARN)
229-
self.assertIsNotNone(function_arn)
230-
self.assertIn("lambda-function-name-foo", function_arn)
231220
self.assertIsNone(span.attributes.get(AWS_LAMBDA_RESOURCE_MAPPING_ID))
232221

233222
@mock_aws
@@ -253,9 +242,6 @@ def test_create_event_source_mapping(self):
253242
"CreateEventSourceMapping",
254243
span.attributes[SpanAttributes.RPC_METHOD],
255244
)
256-
self.assertEqual(
257-
"MyLambdaFnFoo", span.attributes[AWS_LAMBDA_FUNCTION_NAME]
258-
)
259245

260246
uuid = span.attributes.get(AWS_LAMBDA_RESOURCE_MAPPING_ID)
261247
self.assertIsNotNone(uuid)
@@ -293,5 +279,3 @@ def test_get_event_source_mapping(self):
293279
uuid = span.attributes.get(AWS_LAMBDA_RESOURCE_MAPPING_ID)
294280
self.assertIsNotNone(uuid)
295281
self.assertEqual(expected_uuid, uuid)
296-
self.assertIsNone(span.attributes.get(AWS_LAMBDA_FUNCTION_ARN))
297-
self.assertIsNone(span.attributes.get(AWS_LAMBDA_FUNCTION_NAME))

0 commit comments

Comments
 (0)