Skip to content

Commit 513b9bc

Browse files
committed
remove docstring
1 parent f3d5ca0 commit 513b9bc

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

src/mcp/server/_otel.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,7 @@
1212

1313

1414
class OpenTelemetryMiddleware(ServerMiddleware[Any]):
15-
"""Context-tier middleware that wraps each inbound message in an OpenTelemetry span.
16-
17-
Span name `"<method> [<target>]"`, `mcp.method.name` attribute, W3C trace context extracted from
18-
`params._meta` (SEP-414), and an ERROR status if the handler raises. Requests and notifications both get a span;
19-
`jsonrpc.request.id` is set only when `ctx.request_id` is present (notifications have none).
20-
21-
Tool and prompt operations additionally carry the GenAI semantic-convention attributes `gen_ai.tool.name` /
22-
`gen_ai.prompt.name`, and `gen_ai.operation.name` is set to `execute_tool` for `tools/call`. A protocol or
23-
validation failure sets `error.type` and `rpc.response.status_code` to the JSON-RPC error code as a string
24-
(e.g. `-32602`); any other handler exception sets `error.type` to its type name (the wire code is not yet known
25-
here). A `tools/call` result carrying `is_error` sets `error.type` to `tool_error`.
26-
"""
15+
"""Context-tier middleware that wraps each inbound message in an OpenTelemetry span."""
2716

2817
async def __call__(self, ctx: ServerRequestContext[Any, Any], call_next: CallNext) -> HandlerResult:
2918
name = ctx.params.get("name") if ctx.params else None

0 commit comments

Comments
 (0)