Skip to content

Commit b0c266c

Browse files
committed
clean: Remove auto-instrumentation support for Kinesis Stream Consumer
1 parent f05d295 commit b0c266c

File tree

5 files changed

+1
-35
lines changed

5 files changed

+1
-35
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
AWS_SQS_QUEUE_URL: str = "aws.sqs.queue.url"
2020
AWS_SQS_QUEUE_NAME: str = "aws.sqs.queue.name"
2121
AWS_KINESIS_STREAM_NAME: str = "aws.kinesis.stream.name"
22-
AWS_KINESIS_STREAM_CONSUMERNAME: str = "aws.kinesis.stream.consumer_name"
2322
AWS_BEDROCK_DATA_SOURCE_ID: str = "aws.bedrock.data_source.id"
2423
AWS_BEDROCK_KNOWLEDGE_BASE_ID: str = "aws.bedrock.knowledge_base.id"
2524
AWS_BEDROCK_AGENT_ID: str = "aws.bedrock.agent.id"

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
AWS_BEDROCK_GUARDRAIL_ID,
1212
AWS_BEDROCK_KNOWLEDGE_BASE_ID,
1313
AWS_CLOUDFORMATION_PRIMARY_IDENTIFIER,
14-
AWS_KINESIS_STREAM_CONSUMERNAME,
1514
AWS_KINESIS_STREAM_NAME,
1615
AWS_LAMBDA_FUNCTION_ARN,
1716
AWS_LAMBDA_FUNCTION_NAME,
@@ -398,9 +397,6 @@ def _set_remote_type_and_identifier(span: ReadableSpan, attributes: BoundedAttri
398397
elif is_key_present(span, AWS_KINESIS_STREAM_NAME):
399398
remote_resource_type = _NORMALIZED_KINESIS_SERVICE_NAME + "::Stream"
400399
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_KINESIS_STREAM_NAME))
401-
elif is_key_present(span, AWS_KINESIS_STREAM_CONSUMERNAME):
402-
remote_resource_type = _NORMALIZED_KINESIS_SERVICE_NAME + "::StreamConsumer"
403-
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_KINESIS_STREAM_CONSUMERNAME))
404400
elif is_key_present(span, _AWS_BUCKET_NAME):
405401
remote_resource_type = _NORMALIZED_S3_SERVICE_NAME + "::Bucket"
406402
remote_resource_identifier = _escape_delimiters(span.attributes.get(_AWS_BUCKET_NAME))

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/patches/_botocore_patches.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import importlib
55

66
from amazon.opentelemetry.distro._aws_attribute_keys import (
7-
AWS_KINESIS_STREAM_CONSUMERNAME,
87
AWS_KINESIS_STREAM_NAME,
98
AWS_LAMBDA_FUNCTION_ARN,
109
AWS_LAMBDA_FUNCTION_NAME,
@@ -249,6 +248,3 @@ def extract_attributes(self, attributes: _AttributeMapT):
249248
stream_name = self._call_context.params.get("StreamName")
250249
if stream_name:
251250
attributes[AWS_KINESIS_STREAM_NAME] = stream_name
252-
consumer_name = self._call_context.params.get("ConsumerName")
253-
if consumer_name:
254-
attributes[AWS_KINESIS_STREAM_CONSUMERNAME] = consumer_name

aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_metric_attribute_generator.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
AWS_BEDROCK_GUARDRAIL_ID,
1414
AWS_BEDROCK_KNOWLEDGE_BASE_ID,
1515
AWS_CONSUMER_PARENT_SPAN_KIND,
16-
AWS_KINESIS_STREAM_CONSUMERNAME,
1716
AWS_KINESIS_STREAM_NAME,
1817
AWS_LAMBDA_FUNCTION_NAME,
1918
AWS_LAMBDA_RESOURCEMAPPING_ID,
@@ -1144,27 +1143,6 @@ def test_sdk_client_span_with_remote_resource_attributes(self):
11441143
)
11451144
self._mock_attribute([AWS_STEPFUNCTIONS_ACTIVITY_ARN], [None])
11461145

1147-
# Validate behaviour of AWS_KINESIS_STREAM_CONSUMERNAME present, then remove it.
1148-
self._mock_attribute(
1149-
[AWS_KINESIS_STREAM_CONSUMERNAME],
1150-
["aws_stream_consumername"],
1151-
keys,
1152-
values,
1153-
)
1154-
self._validate_remote_resource_attributes("AWS::Kinesis::StreamConsumer", "aws_stream_consumername")
1155-
self._mock_attribute([AWS_KINESIS_STREAM_CONSUMERNAME], [None])
1156-
1157-
# Validate behaviour with both AWS_KINESIS_STREAM_NAME and AWS_KINESIS_STREAM_CONSUMERNAME
1158-
# present, then remove it.
1159-
self._mock_attribute(
1160-
[AWS_KINESIS_STREAM_NAME, AWS_KINESIS_STREAM_CONSUMERNAME],
1161-
["aws_stream_name", "aws_stream_consumername"],
1162-
keys,
1163-
values,
1164-
)
1165-
self._validate_remote_resource_attributes("AWS::Kinesis::Stream", "aws_stream_name")
1166-
self._mock_attribute([AWS_KINESIS_STREAM_NAME, AWS_KINESIS_STREAM_CONSUMERNAME], [None, None])
1167-
11681146
# Validate behaviour of AWS_LAMBDA_FUNCTION_NAME attribute, then remove it.
11691147
self._mock_attribute([AWS_LAMBDA_FUNCTION_NAME], ["aws_lambda_function_name"], keys, values)
11701148
self._validate_remote_resource_attributes("AWS::Lambda::Function", "aws_lambda_function_name")

aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_instrumentation_patch.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from opentelemetry.trace.span import Span
1818

1919
_STREAM_NAME: str = "streamName"
20-
_CONSUMER_NAME: str = "consumerName"
2120
_BUCKET_NAME: str = "bucketName"
2221
_QUEUE_NAME: str = "queueName"
2322
_QUEUE_URL: str = "queueUrl"
@@ -181,8 +180,6 @@ def _test_patched_botocore_instrumentation(self):
181180
kinesis_attributes: Dict[str, str] = _do_extract_kinesis_attributes()
182181
self.assertTrue("aws.kinesis.stream.name" in kinesis_attributes)
183182
self.assertEqual(kinesis_attributes["aws.kinesis.stream.name"], _STREAM_NAME)
184-
self.assertTrue("aws.kinesis.stream.consumer_name" in kinesis_attributes)
185-
self.assertEqual(kinesis_attributes["aws.kinesis.stream.consumer_name"], _CONSUMER_NAME)
186183

187184
# S3
188185
self.assertTrue("s3" in _KNOWN_EXTENSIONS)
@@ -372,7 +369,7 @@ def _reset_mocks(self):
372369

373370
def _do_extract_kinesis_attributes() -> Dict[str, str]:
374371
service_name: str = "kinesis"
375-
params: Dict[str, str] = {"StreamName": _STREAM_NAME, "ConsumerName": _CONSUMER_NAME}
372+
params: Dict[str, str] = {"StreamName": _STREAM_NAME}
376373
return _do_extract_attributes(service_name, params)
377374

378375

0 commit comments

Comments
 (0)