From 473b0e36ecf16d921dd7ea74f034943dbbdf52c3 Mon Sep 17 00:00:00 2001 From: Chris Guidry Date: Wed, 14 Jan 2026 09:40:43 -0500 Subject: [PATCH] Address review feedback on telemetry docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Be specific about which operations are traced (tools, prompts, resources, resource templates) - Remove "(not the SDK)" parenthetical - Consolidate attribute documentation - remove redundancy in Tracing section - Delete unnecessary examples/diagnostics/__init__.py 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.5 --- docs/servers/telemetry.mdx | 51 ++++---------------------------- examples/diagnostics/__init__.py | 1 - 2 files changed, 5 insertions(+), 47 deletions(-) delete mode 100644 examples/diagnostics/__init__.py diff --git a/docs/servers/telemetry.mdx b/docs/servers/telemetry.mdx index 663fba19d..7fc46d593 100644 --- a/docs/servers/telemetry.mdx +++ b/docs/servers/telemetry.mdx @@ -5,11 +5,11 @@ description: Native OpenTelemetry instrumentation for distributed tracing. icon: chart-line --- -FastMCP includes native OpenTelemetry instrumentation for observability. Traces are automatically generated for all MCP operations, providing visibility into server behavior, request handling, and provider delegation chains. +FastMCP includes native OpenTelemetry instrumentation for observability. Traces are automatically generated for tool, prompt, resource, and resource template operations, providing visibility into server behavior, request handling, and provider delegation chains. ## How It Works -FastMCP uses the OpenTelemetry API (not the SDK) for instrumentation. This means: +FastMCP uses the OpenTelemetry API for instrumentation. This means: - **Zero configuration required** - Instrumentation is always active - **No overhead when unused** - Without an SDK, all operations are no-ops @@ -55,7 +55,7 @@ FastMCP creates spans for all MCP operations, providing end-to-end visibility in ### Server Spans -The server creates spans for core MCP operations: +The server creates spans for each operation: | Span Name | Description | |-----------|-------------| @@ -63,52 +63,11 @@ The server creates spans for core MCP operations: | `resource {uri}` | Resource read (e.g., `resource config://database`) | | `prompt {name}` | Prompt render (e.g., `prompt greeting`) | -Each span includes these attributes: - -| Attribute | Description | -|-----------|-------------| -| `rpc.system` | Always `"mcp"` | -| `rpc.service` | Server name | -| `rpc.method` | MCP method (e.g., `tools/call`, `resources/read`) | -| `fastmcp.server.name` | Server name | -| `fastmcp.component.type` | Component type (`tool`, `resource`, `resource_template`, `prompt`) | -| `fastmcp.component.key` | Full component key | - -### Provider Attributes - -Server spans include provider information via `fastmcp.provider.type`: - -| Provider | Description | -|----------|-------------| -| `LocalProvider` | Components registered directly on the server | -| `FastMCPProvider` | Components from mounted FastMCP servers | -| `ProxyProvider` | Components proxied from remote MCP servers | - -For mounted servers (FastMCPProvider), an additional `delegate {name}` span shows the delegation: - -| Attribute | Description | -|-----------|-------------| -| `fastmcp.delegate.original_name` | Original tool/prompt name before namespacing | -| `fastmcp.delegate.original_uri` | Original resource URI before namespacing | - -For proxy providers, backend identifiers are included: - -| Attribute | Description | -|-----------|-------------| -| `fastmcp.proxy.backend_name` | Remote tool/prompt name | -| `fastmcp.proxy.backend_uri` | Remote resource URI | +For mounted servers, an additional `delegate {name}` span shows the delegation to the child server. ### Client Spans -The FastMCP client also creates spans for outgoing requests: - -| Span Name | Description | -|-----------|-------------| -| `tool {name}` | Client tool call | -| `resource {uri}` | Client resource read | -| `prompt {name}` | Client prompt get | - -Client spans include `rpc.method` to indicate the MCP protocol method being called. +The FastMCP client creates spans for outgoing requests with the same naming pattern (`tool {name}`, `resource {uri}`, `prompt {name}`). ### Span Hierarchy diff --git a/examples/diagnostics/__init__.py b/examples/diagnostics/__init__.py deleted file mode 100644 index 40f9105a0..000000000 --- a/examples/diagnostics/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""FastMCP Diagnostics example - for testing tracing, errors, and observability."""