Skip to content

Commit c796162

Browse files
committed
comments + linting fix
1 parent f943b07 commit c796162

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# SPDX-License-Identifier: Apache-2.0
33
# Modifications Copyright The OpenTelemetry Authors. Licensed under the Apache License 2.0 License.
44
import os
5-
import re
65
from logging import Logger, getLogger
76
from typing import ClassVar, Dict, List, Type, Union
87

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
import logging
4-
import re
54
from typing import Dict, Optional
65

76
import requests
@@ -13,6 +12,9 @@
1312
AWS_SERVICE = "xray"
1413
_logger = logging.getLogger(__name__)
1514

15+
"""The OTLPAwsSigV4Exporter extends the functionality of the OTLPSpanExporter to allow SigV4 authentication if the
16+
configured traces endpoint is a CloudWatch OTLP endpoint https://xray.[AWSRegion].amazonaws.com/v1/traces"""
17+
1618

1719
class OTLPAwsSigV4Exporter(OTLPSpanExporter):
1820

@@ -28,16 +30,21 @@ def __init__(
2830
rsession: Optional[requests.Session] = None,
2931
):
3032

33+
# Represents the region of the CloudWatch OTLP endpoint to send the traces to.
34+
# If the endpoint has been verified to be valid, this should not be None
35+
3136
self._aws_region = None
3237

3338
if endpoint and is_otlp_endpoint_cloudwatch(endpoint):
3439
try:
40+
# Defensive check to verify that the application being auto instrumented has
41+
# botocore installed.
42+
3543
from botocore import auth, awsrequest, session
3644

3745
self.boto_auth = auth
3846
self.boto_aws_request = awsrequest
3947
self.boto_session = session.Session()
40-
4148
self._aws_region = self._validate_exporter_endpoint(endpoint)
4249

4350
except ImportError:

0 commit comments

Comments
 (0)