Skip to content

Commit 8e1d0eb

Browse files
committed
lint fix
1 parent 5637278 commit 8e1d0eb

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

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

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
_logger = logging.getLogger(__name__)
1818

19+
1920
class OTLPAwsSigV4Exporter(OTLPSpanExporter):
2021

2122
def __init__(
@@ -72,24 +73,26 @@ def _export(self, serialized_data: bytes):
7273
def _validate_exporter_endpoint(endpoint: str) -> Optional[str]:
7374
if not endpoint:
7475
return None
75-
76-
match = re.search(f'{AWS_SERVICE}\.([a-z0-9-]+)\.amazonaws\.com', endpoint)
77-
76+
77+
match = re.search(f"{AWS_SERVICE}\.([a-z0-9-]+)\.amazonaws\.com", endpoint)
78+
7879
if match:
7980
region = match.group(1)
8081
xray_regions = session.Session().get_available_regions(AWS_SERVICE)
8182
if region in xray_regions:
8283
return region
83-
84-
_logger.error("Invalid AWS region: %s. Valid regions are %s. Resolving to default endpoint.",
85-
region, xray_regions)
84+
85+
_logger.error(
86+
"Invalid AWS region: %s. Valid regions are %s. Resolving to default endpoint.", region, xray_regions
87+
)
8688
return None
87-
88-
_logger.error("Invalid XRay traces endpoint: %s. Resolving to default endpoint. "
89-
"The traces endpoint follows the pattern https://xray.[AWSRegion].amazonaws.com/v1/traces. "
90-
"For example, for the US West (Oregon) (us-west-2) Region, the endpoint will be "
91-
"https://xray.us-west-2.amazonaws.com/v1/traces.",
92-
endpoint)
93-
94-
return None
9589

90+
_logger.error(
91+
"Invalid XRay traces endpoint: %s. Resolving to default endpoint. "
92+
"The traces endpoint follows the pattern https://xray.[AWSRegion].amazonaws.com/v1/traces. "
93+
"For example, for the US West (Oregon) (us-west-2) Region, the endpoint will be "
94+
"https://xray.us-west-2.amazonaws.com/v1/traces.",
95+
endpoint,
96+
)
97+
98+
return None

0 commit comments

Comments
 (0)