Skip to content

Commit 4df8bbd

Browse files
committed
chore: Apply code style changes
1 parent 6f0b98e commit 4df8bbd

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _apply_botocore_lambda_patch() -> None:
5151
5252
This patch adds an extension to the upstream's list of known extensions for Lambda.
5353
Extensions allow for custom logic for adding service-specific information to spans,
54-
such as attributes. Specifically, we are adding logic to add the
54+
such as attributes. Specifically, we are adding logic to add the
5555
`aws.lambda.function.name` and `aws.lambda.resource_mapping.id` attributes
5656
5757
Sidenote: There exists SpanAttributes.FAAS_INVOKED_NAME for invoke operations
@@ -70,7 +70,7 @@ def patch_extract_attributes(self, attributes: _AttributeMapT):
7070
if resource_mapping_id:
7171
attributes[AWS_LAMBDA_RESOURCEMAPPING_ID] = resource_mapping_id
7272

73-
old_on_success = _LambdaExtension.on_success
73+
old_on_success = _LambdaExtension.on_success
7474

7575
def patch_on_success(self, span: Span, result: _BotoResultT):
7676
old_on_success(self, span, result)
@@ -86,7 +86,7 @@ def patch_on_success(self, span: Span, result: _BotoResultT):
8686
def _apply_botocore_stepfunctions_patch() -> None:
8787
"""Botocore instrumentation patch for StepFunctions
8888
89-
This patch adds an extension to the upstream's list of known extensions for
89+
This patch adds an extension to the upstream's list of known extensions for
9090
StepFunctions. Extensions allow for custom logic for adding service-specific
9191
information to spans, such as attributes. Specifically, we are adding logic
9292
to add the `aws.stepfunctions.state_machine.arn` and `aws.stepfunctions.activity.arn`
@@ -101,7 +101,7 @@ def _apply_botocore_sns_patch() -> None:
101101
102102
This patch adds an extension to the upstream's list of known extensions for SNS.
103103
Extensions allow for custom logic for adding service-specific information to
104-
spans, such as attributes. Specifically, we are adding logic to add the
104+
spans, such as attributes. Specifically, we are adding logic to add the
105105
`aws.sns.topic.arn` attribute, to be used to generate RemoteTarget and achieve
106106
parity with the Java instrumentation.
107107
@@ -119,12 +119,13 @@ def patch_extract_attributes(self, attributes: _AttributeMapT):
119119

120120
_SnsExtension.extract_attributes = patch_extract_attributes
121121

122+
122123
def _apply_botocore_secretsmanager_patch() -> None:
123124
"""Botocore instrumentation patch for SecretsManager
124125
125126
This patch adds an extension to the upstream's list of known extension for SecretsManager.
126127
Extensions allow for custom logic for adding service-specific information to spans, such as
127-
attributes. Specifically, we are adding logic to add the `aws.secretsmanager.secret.arn`
128+
attributes. Specifically, we are adding logic to add the `aws.secretsmanager.secret.arn`
128129
attribute, to be used to generate RemoteTarget and achieve parity with the Java
129130
instrumentation.
130131
"""

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,7 +1108,7 @@ def test_sdk_client_span_with_remote_resource_attributes(self):
11081108
[AWS_SECRETSMANAGER_SECRET_ARN],
11091109
["arn:aws:secretsmanager:us-east-1:123456789012:secret:secret_name-lERW9H"],
11101110
keys,
1111-
values
1111+
values,
11121112
)
11131113
self._validate_remote_resource_attributes(
11141114
"AWS::SecretsManager::Secret", "arn:aws:secretsmanager:us-east-1:123456789012:secret:secret_name-lERW9H"
@@ -1122,14 +1122,13 @@ def test_sdk_client_span_with_remote_resource_attributes(self):
11221122

11231123
# Validate behaviour of AWS_STEPFUNCTIONS_STATEMACHINE_ARN attribute, then remove it.
11241124
self._mock_attribute(
1125-
[AWS_STEPFUNCTIONS_STATEMACHINE_ARN],
1126-
["arn:aws:states:us-east-1:123456789012:stateMachine:test_state_machine"],
1127-
keys,
1128-
values
1125+
[AWS_STEPFUNCTIONS_STATEMACHINE_ARN],
1126+
["arn:aws:states:us-east-1:123456789012:stateMachine:test_state_machine"],
1127+
keys,
1128+
values,
11291129
)
11301130
self._validate_remote_resource_attributes(
1131-
"AWS::StepFunctions::StateMachine",
1132-
"arn:aws:states:us-east-1:123456789012:stateMachine:test_state_machine"
1131+
"AWS::StepFunctions::StateMachine", "arn:aws:states:us-east-1:123456789012:stateMachine:test_state_machine"
11331132
)
11341133
self._mock_attribute([AWS_STEPFUNCTIONS_STATEMACHINE_ARN], [None])
11351134

@@ -1152,10 +1151,7 @@ def test_sdk_client_span_with_remote_resource_attributes(self):
11521151
keys,
11531152
values,
11541153
)
1155-
self._validate_remote_resource_attributes(
1156-
"AWS::Kinesis::StreamConsumer",
1157-
"aws_stream_consumername"
1158-
)
1154+
self._validate_remote_resource_attributes("AWS::Kinesis::StreamConsumer", "aws_stream_consumername")
11591155
self._mock_attribute([AWS_KINESIS_STREAM_CONSUMERNAME], [None])
11601156

11611157
# Validate behaviour with both AWS_KINESIS_STREAM_NAME and AWS_KINESIS_STREAM_CONSUMERNAME
@@ -1185,7 +1181,7 @@ def test_sdk_client_span_with_remote_resource_attributes(self):
11851181
[AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_RESOURCEMAPPING_ID],
11861182
["aws_lambda_function_name", "aws_event_source_mapping_id"],
11871183
keys,
1188-
values
1184+
values,
11891185
)
11901186
self._validate_remote_resource_attributes("AWS::Lambda::EventSourceMapping", "aws_event_source_mapping_id")
11911187
self._mock_attribute([AWS_LAMBDA_FUNCTION_NAME, AWS_LAMBDA_RESOURCEMAPPING_ID], [None, None])

0 commit comments

Comments
 (0)