Skip to content

Commit 99602a3

Browse files
lint
1 parent 41a0aeb commit 99602a3

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ class TornadoInstrumentor(BaseInstrumentor):
262262
def instrumentation_dependencies(self) -> Collection[str]:
263263
return _instruments
264264

265-
def _instrument(self, **kwargs):
265+
def _instrument(self, **kwargs): # pylint: disable=too-many-locals
266266
"""
267267
_instrument patches tornado.web.RequestHandler and tornado.httpclient.AsyncHTTPClient classes
268268
to automatically instrument requests both received and sent by Tornado.
@@ -282,7 +282,7 @@ def _instrument(self, **kwargs):
282282
Note that the patch does not apply on every single __init__ call, only the first one for the entire
283283
process lifetime.
284284
"""
285-
global _sem_conv_opt_in_mode
285+
global _sem_conv_opt_in_mode # pylint: disable=global-statement
286286

287287
# Initialize semantic conventions opt-in mode
288288
_OpenTelemetrySemanticConventionStability._initialize()
@@ -370,7 +370,7 @@ def handler_init(init, handler, args, kwargs):
370370
)
371371

372372
def _uninstrument(self, **kwargs):
373-
global _sem_conv_opt_in_mode
373+
global _sem_conv_opt_in_mode # pylint: disable=global-statement
374374
_sem_conv_opt_in_mode = _StabilityMode.DEFAULT
375375

376376
unwrap(tornado.web.RequestHandler, "__init__")

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _normalize_request(args, kwargs):
5959
return (new_args, new_kwargs)
6060

6161

62-
def fetch_async(
62+
def fetch_async( # pylint: disable=too-many-locals
6363
tracer,
6464
request_hook,
6565
response_hook,
@@ -130,7 +130,7 @@ def fetch_async(
130130
return future
131131

132132

133-
def _finish_tracing_callback(
133+
def _finish_tracing_callback( # pylint: disable=too-many-locals,too-many-branches
134134
future,
135135
span,
136136
response_hook,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def setUp(self):
7777
_OpenTelemetrySemanticConventionStability,
7878
)
7979

80-
_OpenTelemetrySemanticConventionStability._initialized = False
80+
_OpenTelemetrySemanticConventionStability._initialized = False # pylint: disable=protected-access
8181
TornadoInstrumentor().instrument(
8282
server_request_hook=getattr(self, "server_request_hook", None),
8383
client_request_hook=getattr(self, "client_request_hook", None),

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,20 +300,19 @@ def get_app(self):
300300
app = make_app(tracer)
301301
return app
302302

303-
def setUp(self):
304-
super().setUp()
305-
306303
def tearDown(self):
307304
TornadoInstrumentor().uninstrument()
308305
super().tearDown()
309306

310-
def _get_server_span(self, spans):
307+
@staticmethod
308+
def _get_server_span(spans):
311309
for span in spans:
312310
if span.kind == SpanKind.SERVER:
313311
return span
314312
return None
315313

316-
def _get_client_span(self, spans):
314+
@staticmethod
315+
def _get_client_span(spans):
317316
for span in spans:
318317
if span.kind == SpanKind.CLIENT:
319318
return span

0 commit comments

Comments
 (0)