Skip to content

Commit cbb3e4d

Browse files
committed
lint fix
1 parent 516de12 commit cbb3e4d

File tree

6 files changed

+27
-20
lines changed

6 files changed

+27
-20
lines changed

instrumentation/opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/client.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def _finish_tracing_callback(
113113
if isinstance(exc, HTTPError):
114114
status_code = exc.code
115115
description = f"{type(exc).__name__}: {exc}"
116-
116+
117117
response = None
118118
if not exc:
119119
response = future.result()
@@ -136,8 +136,12 @@ def _finish_tracing_callback(
136136
duration_histogram.record(
137137
response.request_time, attributes=metric_attributes
138138
)
139-
request_size_histogram.record(request_size, attributes=metric_attributes)
140-
response_size_histogram.record(response_size, attributes=metric_attributes)
139+
request_size_histogram.record(
140+
request_size, attributes=metric_attributes
141+
)
142+
response_size_histogram.record(
143+
response_size, attributes=metric_attributes
144+
)
141145

142146
if response_hook:
143147
response_hook(span, future)

instrumentation/opentelemetry-instrumentation-tornado/tests/test_instrumentation.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
from urllib.error import HTTPError
1818

1919
from http_server_mock import HttpServerMock
20-
from tornado.testing import AsyncHTTPTestCase
2120
from tornado.httpclient import HTTPClientError
21+
from tornado.testing import AsyncHTTPTestCase
2222

2323
from opentelemetry import trace
2424
from opentelemetry.instrumentation.propagators import (
@@ -603,6 +603,7 @@ def client_response_hook(span, response):
603603

604604
self.memory_exporter.clear()
605605

606+
606607
class TestTornadoHTTPClientInstrumentation(TornadoTest, WsgiTestBase):
607608
def test_http_client_success_response(self):
608609
response = self.fetch("/")
@@ -646,6 +647,7 @@ def test_http_client_failed_response(self):
646647
self.assertEqual(client.name, "GET")
647648
self.memory_exporter.clear()
648649

650+
649651
class TestTornadoUninstrument(TornadoTest):
650652
def test_uninstrument(self):
651653
response = self.fetch("/")

resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/app_service.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,21 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from typing import Optional
1615
from os import environ
16+
from typing import Optional
1717

18+
from opentelemetry.resource.detector.azure._utils import (
19+
_get_azure_resource_uri,
20+
_is_on_functions,
21+
)
1822
from opentelemetry.sdk.resources import Resource, ResourceDetector
1923
from opentelemetry.semconv.resource import (
2024
CloudPlatformValues,
2125
CloudProviderValues,
2226
ResourceAttributes,
2327
)
24-
from opentelemetry.resource.detector.azure._utils import _get_azure_resource_uri
25-
26-
from ._constants import (
27-
_APP_SERVICE_ATTRIBUTE_ENV_VARS,
28-
_WEBSITE_SITE_NAME,
29-
)
3028

31-
from opentelemetry.resource.detector.azure._utils import _is_on_functions
29+
from ._constants import _APP_SERVICE_ATTRIBUTE_ENV_VARS, _WEBSITE_SITE_NAME
3230

3331

3432
class AzureAppServiceResourceDetector(ResourceDetector):

resource/opentelemetry-resource-detector-azure/src/opentelemetry/resource/detector/azure/functions.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
from os import environ, getpid
1616

17+
from opentelemetry.resource.detector.azure._utils import (
18+
_get_azure_resource_uri,
19+
_is_on_functions,
20+
)
1721
from opentelemetry.sdk.resources import Resource, ResourceDetector
1822
from opentelemetry.semconv.resource import (
1923
CloudPlatformValues,
@@ -26,10 +30,6 @@
2630
_REGION_NAME,
2731
_WEBSITE_SITE_NAME,
2832
)
29-
from opentelemetry.resource.detector.azure._utils import (
30-
_get_azure_resource_uri,
31-
_is_on_functions,
32-
)
3333

3434

3535
class AzureFunctionsResourceDetector(ResourceDetector):
@@ -65,4 +65,3 @@ def detect(self) -> Resource:
6565
attributes[key] = value
6666

6767
return Resource(attributes)
68-

resource/opentelemetry-resource-detector-azure/tests/test_app_service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_on_app_service(self):
6868
self.assertEqual(
6969
attributes["azure.app.service.stamp"], TEST_WEBSITE_HOME_STAMPNAME
7070
)
71-
71+
7272
@patch.dict(
7373
"os.environ",
7474
{

util/opentelemetry-util-http/tests/test_remove_credentials.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ def test_remove_credentials(self):
1919
def test_remove_credentials_ipv4_literal(self):
2020
url = "http://someuser:[email protected]:8080/test/path?query=value"
2121
cleaned_url = remove_url_credentials(url)
22-
self.assertEqual(cleaned_url, "http://127.0.0.1:8080/test/path?query=value")
22+
self.assertEqual(
23+
cleaned_url, "http://127.0.0.1:8080/test/path?query=value"
24+
)
2325

2426
def test_remove_credentials_ipv6_literal(self):
2527
url = "http://someuser:somepass@[::1]:8080/test/path?query=value"
2628
cleaned_url = remove_url_credentials(url)
27-
self.assertEqual(cleaned_url, "http://[::1]:8080/test/path?query=value")
29+
self.assertEqual(
30+
cleaned_url, "http://[::1]:8080/test/path?query=value"
31+
)

0 commit comments

Comments
 (0)