Skip to content

Commit d5e0666

Browse files
committed
chore: Apply code style changes
1 parent b0c266c commit d5e0666

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,19 +432,27 @@ def _set_remote_type_and_identifier(span: ReadableSpan, attributes: BoundedAttri
432432
remote_resource_identifier = _escape_delimiters(span.attributes.get(GEN_AI_REQUEST_MODEL))
433433
elif is_key_present(span, AWS_SECRETSMANAGER_SECRET_ARN):
434434
remote_resource_type = _NORMALIZED_SECRETSMANAGER_SERVICE_NAME + "::Secret"
435-
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_SECRETSMANAGER_SECRET_ARN)).split(":")[-1]
435+
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_SECRETSMANAGER_SECRET_ARN)).split(
436+
":"
437+
)[-1]
436438
cloudformation_primary_identifier = _escape_delimiters(span.attributes.get(AWS_SECRETSMANAGER_SECRET_ARN))
437439
elif is_key_present(span, AWS_SNS_TOPIC_ARN):
438440
remote_resource_type = _NORMALIZED_SNS_SERVICE_NAME + "::Topic"
439441
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_SNS_TOPIC_ARN)).split(":")[-1]
440442
cloudformation_primary_identifier = _escape_delimiters(span.attributes.get(AWS_SNS_TOPIC_ARN))
441443
elif is_key_present(span, AWS_STEPFUNCTIONS_STATEMACHINE_ARN):
442444
remote_resource_type = _NORMALIZED_STEPFUNCTIONS_SERVICE_NAME + "::StateMachine"
443-
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_STEPFUNCTIONS_STATEMACHINE_ARN)).split(":")[-1]
444-
cloudformation_primary_identifier = _escape_delimiters(span.attributes.get(AWS_STEPFUNCTIONS_STATEMACHINE_ARN))
445+
remote_resource_identifier = _escape_delimiters(
446+
span.attributes.get(AWS_STEPFUNCTIONS_STATEMACHINE_ARN)
447+
).split(":")[-1]
448+
cloudformation_primary_identifier = _escape_delimiters(
449+
span.attributes.get(AWS_STEPFUNCTIONS_STATEMACHINE_ARN)
450+
)
445451
elif is_key_present(span, AWS_STEPFUNCTIONS_ACTIVITY_ARN):
446452
remote_resource_type = _NORMALIZED_STEPFUNCTIONS_SERVICE_NAME + "::Activity"
447-
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_STEPFUNCTIONS_ACTIVITY_ARN)).split(":")[-1]
453+
remote_resource_identifier = _escape_delimiters(span.attributes.get(AWS_STEPFUNCTIONS_ACTIVITY_ARN)).split(
454+
":"
455+
)[-1]
448456
cloudformation_primary_identifier = _escape_delimiters(span.attributes.get(AWS_STEPFUNCTIONS_ACTIVITY_ARN))
449457
elif is_key_present(span, AWS_LAMBDA_RESOURCEMAPPING_ID):
450458
remote_resource_type = _NORMALIZED_LAMBDA_SERVICE_NAME + "::EventSourceMapping"

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,9 +1109,7 @@ def test_sdk_client_span_with_remote_resource_attributes(self):
11091109
keys,
11101110
values,
11111111
)
1112-
self._validate_remote_resource_attributes(
1113-
"AWS::SecretsManager::Secret", "secret_name-lERW9H"
1114-
)
1112+
self._validate_remote_resource_attributes("AWS::SecretsManager::Secret", "secret_name-lERW9H")
11151113
self._mock_attribute([AWS_SECRETSMANAGER_SECRET_ARN], [None])
11161114

11171115
# Validate behaviour of AWS_SNS_TOPIC_ARN attribute, then remove it.
@@ -1126,9 +1124,7 @@ def test_sdk_client_span_with_remote_resource_attributes(self):
11261124
keys,
11271125
values,
11281126
)
1129-
self._validate_remote_resource_attributes(
1130-
"AWS::StepFunctions::StateMachine", "test_state_machine"
1131-
)
1127+
self._validate_remote_resource_attributes("AWS::StepFunctions::StateMachine", "test_state_machine")
11321128
self._mock_attribute([AWS_STEPFUNCTIONS_STATEMACHINE_ARN], [None])
11331129

11341130
# Validate behaviour of AWS_STEPFUNCTIONS_ACTIVITY_ARN attribute, then remove it.
@@ -1138,9 +1134,7 @@ def test_sdk_client_span_with_remote_resource_attributes(self):
11381134
keys,
11391135
values,
11401136
)
1141-
self._validate_remote_resource_attributes(
1142-
"AWS::StepFunctions::Activity", "testActivity"
1143-
)
1137+
self._validate_remote_resource_attributes("AWS::StepFunctions::Activity", "testActivity")
11441138
self._mock_attribute([AWS_STEPFUNCTIONS_ACTIVITY_ARN], [None])
11451139

11461140
# Validate behaviour of AWS_LAMBDA_FUNCTION_NAME attribute, then remove it.

0 commit comments

Comments
 (0)