Skip to content

Commit db1af61

Browse files
committed
Testing lint checker 2
1 parent 6a5f9d6 commit db1af61

File tree

1 file changed

+7
-3
lines changed
  • aws-opentelemetry-distro/src/amazon/opentelemetry/distro/mcpinstrumentor

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ def setup_logger_two():
2424
return logger
2525

2626

27-
class MCPInstrumentor(BaseInstrumentor): # pylint: disable=attribute-defined-outside-init
27+
class MCPInstrumentor(BaseInstrumentor):
2828
"""
2929
An instrumenter for MCP.
3030
"""
3131

32+
def __init__(self):
33+
super().__init__()
34+
self.tracer = None
35+
3236
# Send Request Wrapper
3337
def _wrap_send_request(self, wrapped, instance, args, kwargs):
3438
"""
@@ -125,7 +129,7 @@ def _extract_span_context_from_traceparent(self, traceparent): # pylint: disabl
125129

126130
def _get_span_name(self, req): # pylint: disable=no-self-use
127131
span_name = "unknown"
128-
import mcp.types as types # pylint: disable=import-outside-toplevel
132+
import mcp.types as types # pylint: disable=import-outside-toplevel,consider-using-from-import
129133

130134
if isinstance(req, types.ListToolsRequest):
131135
span_name = "tools/list"
@@ -137,7 +141,7 @@ def _get_span_name(self, req): # pylint: disable=no-self-use
137141
return span_name
138142

139143
def handle_attributes(self, span, request, is_client=True):
140-
import mcp.types as types # pylint: disable=import-outside-toplevel
144+
import mcp.types as types # pylint: disable=import-outside-toplevel,consider-using-from-import
141145

142146
operation = self._get_span_name(request)
143147
if isinstance(request, types.ListToolsRequest):

0 commit comments

Comments
 (0)