Skip to content

Commit f4261ba

Browse files
committed
Fix lint
1 parent 1484ef0 commit f4261ba

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

instrumentation/opentelemetry-instrumentation-urllib3/src/opentelemetry/instrumentation/urllib3/__init__.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,23 @@ def instrumented_urlopen(wrapped, instance, args, kwargs):
217217
SpanAttributes.HTTP_SCHEME: instance.scheme,
218218
SpanAttributes.HTTP_STATUS_CODE: response.status,
219219
SpanAttributes.NET_PEER_NAME: instance.host,
220-
SpanAttributes.NET_PEER_PORT: instance.port
220+
SpanAttributes.NET_PEER_PORT: instance.port,
221221
}
222222

223223
version = getattr(response, "version")
224224
if version:
225-
metric_labels[SpanAttributes.HTTP_FLAVOR] = \
225+
metric_labels[SpanAttributes.HTTP_FLAVOR] = (
226226
"1.1" if version == 11 else "1.0"
227+
)
227228

228229
request_size = 0 if body is None else len(body)
229230
duration_histogram.record(elapsed_time, attributes=metric_labels)
230-
request_size_histogram.record(request_size, attributes=metric_labels)
231-
response_size_histogram.record(len(response.data), attributes=metric_labels)
231+
request_size_histogram.record(
232+
request_size, attributes=metric_labels
233+
)
234+
response_size_histogram.record(
235+
len(response.data), attributes=metric_labels
236+
)
232237

233238
return response
234239

instrumentation/opentelemetry-instrumentation-urllib3/tests/test_urllib3_ip_support.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ def assert_span(self, num_spans=1):
7272
return span_list[0]
7373
return span_list
7474

75-
def assert_success_span(self, response: urllib3.response.HTTPResponse, url: str):
75+
def assert_success_span(
76+
self, response: urllib3.response.HTTPResponse, url: str
77+
):
7678
self.assertEqual(b"Hello!", response.data)
7779

7880
span = self.assert_span()
@@ -145,7 +147,8 @@ def test_basic_metric_check_client_size_get(self):
145147
)
146148
self.assertIn(metric.name, expected_metrics)
147149
self.assertDictEqual(
148-
expected_attributes, dict(data_point.attributes)
150+
expected_attributes,
151+
dict(data_point.attributes),
149152
)
150153
self.assertEqual(data_point.count, 1)
151154

@@ -199,6 +202,7 @@ def test_basic_metric_check_client_size_post(self):
199202
self.assertIn(metric.name, expected_metrics)
200203

201204
self.assertDictEqual(
202-
expected_attributes, dict(data_point.attributes)
205+
expected_attributes,
206+
dict(data_point.attributes),
203207
)
204208
self.assertEqual(data_point.count, 1)

0 commit comments

Comments
 (0)