Skip to content

Commit 7ca0947

Browse files
committed
fix format
1 parent 298f935 commit 7ca0947

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

instrumentation/opentelemetry-instrumentation-aiohttp-client/tests/test_aiohttp_client_integration.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,9 +1621,7 @@ def test_ignores_excluded_urls(self):
16211621
self._assert_spans(0)
16221622
self._assert_metrics(0)
16231623

1624-
@mock.patch.dict(
1625-
os.environ, {OTEL_SEMCONV_STABILITY_OPT_IN: "http"}
1626-
)
1624+
@mock.patch.dict(os.environ, {OTEL_SEMCONV_STABILITY_OPT_IN: "http"})
16271625
def test_response_body_size_not_set_by_default(self):
16281626
AioHttpClientInstrumentor().uninstrument()
16291627
AioHttpClientInstrumentor().instrument()
@@ -1649,9 +1647,7 @@ def test_response_body_size_set_on_span(self):
16491647
)
16501648
span = self._assert_spans(1)
16511649
self.assertIn(HTTP_RESPONSE_BODY_SIZE, span.attributes)
1652-
self.assertIsInstance(
1653-
span.attributes[HTTP_RESPONSE_BODY_SIZE], int
1654-
)
1650+
self.assertIsInstance(span.attributes[HTTP_RESPONSE_BODY_SIZE], int)
16551651

16561652
@mock.patch.dict(
16571653
"os.environ",
@@ -1668,13 +1664,9 @@ def test_response_body_size_metric_recorded(self):
16681664
)
16691665
metrics = self._assert_metrics(2)
16701666
metric_names = {m.name for m in metrics}
1671-
self.assertIn(
1672-
"http.client.response.body.size", metric_names
1673-
)
1667+
self.assertIn("http.client.response.body.size", metric_names)
16741668
body_size_metric = next(
1675-
m
1676-
for m in metrics
1677-
if m.name == "http.client.response.body.size"
1669+
m for m in metrics if m.name == "http.client.response.body.size"
16781670
)
16791671
data_point = body_size_metric.data.data_points[0]
16801672
self.assertEqual(data_point.count, 1)

util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ def get_custom_header_attributes(
278278
headers, captured_headers, normalize_function
279279
)
280280

281+
281282
def is_capture_response_body_size_enabled() -> bool:
282283
return (
283284
environ.get(
@@ -286,6 +287,7 @@ def is_capture_response_body_size_enabled() -> bool:
286287
== "true"
287288
)
288289

290+
289291
def _parse_active_request_count_attrs(req_attrs):
290292
active_requests_count_attrs = {
291293
key: req_attrs[key]

0 commit comments

Comments
 (0)