Update OTel docs to match current implementation#584
Conversation
Update observability documentation to reflect the current ToolHive OpenTelemetry implementation, including new semantic convention attribute names, vMCP metrics, trace context propagation, and the legacy attributes compatibility flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Updates ToolHive observability documentation to align with the current OpenTelemetry attribute/metric naming scheme, and expands vMCP telemetry guidance so users can more easily interpret traces and metrics across ToolHive and vMCP deployments.
Changes:
- Updated trace attribute examples to use newer OTel semantic convention attribute names (HTTP/MCP/GenAI).
- Added vMCP-specific metrics sections (backend/workflow/optimizer) and expanded distributed tracing details.
- Updated CLI telemetry docs to include
--otel-use-legacy-attributesand corrected the documented default service name.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/toolhive/guides-vmcp/telemetry-and-metrics.mdx | Adds vMCP metric inventories and tracing span naming/attributes; updates sampling example. |
| docs/toolhive/guides-cli/telemetry-and-metrics.mdx | Documents default service name, adds --otel-use-legacy-attributes flag to usage + table. |
| docs/toolhive/concepts/observability.mdx | Refreshes trace/attribute examples, adds MCP semantic-convention metrics + trace context propagation section. |
danbarr
left a comment
There was a problem hiding this comment.
Two accuracy issues to address before merge:
1. mcp.is_batch: false in trace example
In concepts/observability.mdx, the MCP protocol details code block shows mcp.is_batch: false. The code only emits this attribute when IsBatch == true (middleware.go:358-359) — it won't appear in typical traces. Remove it from the example or add a note that it only appears for batch requests.
2. initialize span: mcp.client.name silently dropped
The PR replaces mcp.client.name with mcp.protocol.version in the method-specific attributes for initialize spans. But mcp.client.name is always emitted for initialize spans — it is not gated by UseLegacyAttributes (middleware.go:436-439). The operator docs from #3784 still list it. Either keep mcp.client.name alongside mcp.protocol.version, or clarify that it is a ToolHive-specific attribute that is always emitted.
🤖 Generated with Claude Code
- Remove mcp.is_batch from trace example (only emitted when true) - Add mcp.client.name to initialize span attributes (always emitted) - Clarify OTLP vs Prometheus metric naming for MCP semantic conventions - Document Prometheus-safe name for mcp.client.operation.duration Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@danbarr Pushed up changes |
Summary
http.request.method,mcp.method.name,gen_ai.tool.name, etc.) instead of legacy names--otel-use-legacy-attributesflag to CLI telemetry guide and fix default service namemcp.server.operation.duration,mcp.client.operation.duration) and trace context propagation section to concepts pageTest plan
pkg/telemetry/pkg/vmcp/server/telemetry.go🤖 Generated with Claude Code