MCP: expose span status and status message in inspect_span
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- api, observability
调研方向
Start by reading packages/domain/src/mcp-outputs/traces.ts to compare TraceSpanOutput, which already carries status, against InspectSpanOutput, which does not. Then follow apps/ai/src/mcp/tools/inspect-span.ts for the handler and renderer, using apps/ai/src/mcp/lib/render-trace.ts as the rendering reference; check whether the span-detail query already selects statusCode/statusMessage before extending it. Done looks like structured and text output showing Unset, Ok, and Error distinctly, agreeing with inspect_trace, plus tests for error-with-message, error-without-message, Ok, Unset, and missing span.
由索引模型根据 Issue 内容生成。
描述
Problem
An agent inspecting one span cannot read its explicit OpenTelemetry status from inspect_span. The tool returns span attributes, resource attributes, and an optional AI decode, but its output schema and renderer omit statusCode and statusMessage.
A Worker can catch a failed operation, mark its custom span as an error, and still return a successful HTTP response. An agent needs that span status to understand the operation's result. Currently it must fetch inspect_trace separately, which already exposes these fields.
Why this matters for Cloudflare now
Cloudflare's October 26, 2026 Workers tracing update adds span.setStatus() to native custom spans. The explicit status and optional error message are included in exported OTLP traces, while the Workers Observability dashboard does not yet show span status.
This makes the existing MCP output gap more useful to close. The feature should work for spans from all OpenTelemetry producers.
Current code
Checked against main at 7edfccb17c3f524f9d793e0a11893fcf0535737e:
InspectSpanOutputandTraceSpanOutput: the single-span output omits status; the trace-span output includes it.inspect_spanhandler and renderer.inspect_tracerenderer already renders explicit status and error messages.
Proposed change
Expose the stored statusCode and statusMessage in both the structured and text results of inspect_span. Keep existing attributes, AI decoding, and missing-span behavior. Extend the span-detail query if needed.
Keep HTTP response status and OpenTelemetry span status separate. Do not infer an explicit Ok from a missing or unset status.
Acceptance criteria
inspect_spanreturns and renders the stored status and error message for a found span.- Unset, Ok, and Error remain distinct and agree with
inspect_tracefor the same span. - A custom span marked Error remains visible as failed even when the enclosing HTTP request succeeds.
- Tests cover an error with a message, an error without a message, Ok, Unset, and a missing span.
- Include a native Workers OTLP fixture using
setStatus({ code: "error", message: "Probe failed" }), or verify the same path with a small Worker export.
Evidence: source inspection. A live Cloudflare-to-Maple export has not been tested for this report.
- 主要语言
- TypeScript
- 星标
- 1.8k
- 派生
- 120
- 平均合并
- 8 小时 19 分钟
- 30 天内合并 PR
- 652
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MapleTechLabs/maple 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
MapleTechLabs/maple#1921 · 1 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
MapleTechLabs/maple#1888 ·
维护者通常 1 天内回复
-
@maple-dev/alchemy: typed dashboard props, a managed refresh interval, and adopting a dashboard built in the UI可能已有人在做 @jasonkuhrt 于 3 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 18/100
MapleTechLabs/maple#1891 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
MapleTechLabs/maple#1874 ·
维护者通常 1 天内回复
-
Proposal: use the chdb npm package instead of direct libchdb FFI可能已有人在做 @ShawnChen-Sirius 于 52 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
MapleTechLabs/maple#789 · 1 条评论 ·
维护者通常 1 天内回复
查看 MapleTechLabs/maple 的全部 Issue
相似的 Issue
-
bug triage
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
hemi-earn
难度 2/5 1-3 小时 新手友好度 82/100
vetro-protocol/vetro-monorepo#1043 ·
维护者通常 1 天内回复
-
stage 2: bare names resolve against PATH differently from the shell (empty and relative entries)未关闭
难度 2/5 1-3 小时 新手友好度 82/100
STRML/omp-classifier#206 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
atlassian-labs/mermaid-diagrams-viewer#188 ·
维护者通常 1 天内回复
-
dashboard enhancement
难度 2/5 1-3 小时 新手友好度 76/100
Olanetsoft/agent-lookout#225 ·
维护者通常 1 天内回复