From adcb3d3add07ea8474a1eeedee22fd71950f71ba Mon Sep 17 00:00:00 2001 From: ADOT Patch workflow Date: Tue, 6 Feb 2024 10:32:14 -0800 Subject: [PATCH] Fix based on comment --- .../distro/test_aws_metric_attribute_generator.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 310401537..a6a341ea0 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 @@ -38,7 +38,7 @@ _INTERNAL_OPERATION: str = "InternalOperation" _LOCAL_ROOT: str = "LOCAL_ROOT" -_GENERATOR = _AwsMetricAttributeGenerator() +_GENERATOR: _AwsMetricAttributeGenerator = _AwsMetricAttributeGenerator() # pylint: disable=too-many-public-methods @@ -422,14 +422,14 @@ def test_remote_attributes_combinations(self): # Validate behaviour of extracting Remote Service from net.peer.name and net.peer.port keys, values = self._mock_attribute( - [SpanAttributes.NET_PEER_NAME, SpanAttributes.NET_SOCK_PEER_PORT], + [SpanAttributes.NET_PEER_NAME, SpanAttributes.NET_PEER_PORT], ["192.168.0.0", "8081"], keys, values, ) - self._validate_expected_remote_attributes("192.168.0.0", _UNKNOWN_REMOTE_OPERATION) + self._validate_expected_remote_attributes("192.168.0.0:8081", _UNKNOWN_REMOTE_OPERATION) keys, values = self._mock_attribute( - [SpanAttributes.NET_PEER_NAME, SpanAttributes.NET_SOCK_PEER_PORT], [None, None], keys, values + [SpanAttributes.NET_PEER_NAME, SpanAttributes.NET_PEER_PORT], [None, None], keys, values ) # Validate behaviour of extracting Remote Service from net.peer.socket.addr @@ -543,9 +543,9 @@ def _update_resource_with_service_name(self) -> None: def _mock_attribute( self, keys: list[str], - values: [Optional[str]], - exist_keys: Optional[str] = None, - exist_values: Optional[Optional[str]] = None, + values: Optional[list[str]], + exist_keys: Optional[list[str]] = None, + exist_values: Optional[list[str]] = None, ) -> (Optional[list[str]], Optional[list[str]]): if exist_keys is not None and exist_values is not None: for key in exist_keys: