MCP: add a structured Cloudflare Workers summary to inspect_span
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- ai, observability
調査の方向性
Start with the UI Cloudflare adapter in packages/ui/src/lib/cloud-platforms/cloudflare.ts to see how it detects Workers and maps fields, then read apps/ai/src/mcp/tools/inspect-span.ts for the raw attribute output. The change moves detection and mapping into shared pure logic and adds an optional Workers section to the MCP result. Done means tests cover missing fields, zero timing values, and a renamed custom span that keeps its stored name and IDs, and the guidance text covers the clock, sampling, and propagation limits.
索引モデルが issue の本文から書いたものです。
説明
Problem
Maple's web UI already interprets Cloudflare Workers attributes, but MCP inspect_span exposes those fields as raw span/resource attribute maps. An agent must repeatedly work out which fields identify the script, version, execution region, CPU time, wall time, TTFB, and Ray ID.
A compact structured Cloudflare summary would make incident analysis more consistent and reduce the amount of attribute interpretation each agent must do.
Existing support and code
Maple already documents native Workers OTLP destinations. Checked against main at 7edfccb17c3f524f9d793e0a11893fcf0535737e:
- The UI Cloudflare adapter detects Workers and displays script/version, handler, execution model, CPU/wall time, TTFB, colo/region, location, outcome, and Ray ID.
inspect_spanprovides raw attributes and a special decoded view for AI spans.
Proposed change
Add an optional Cloudflare Workers section to the structured and text output of inspect_span. Align its detection and field mapping with the existing UI adapter, preferably through shared pure logic that has no UI dependency.
Include fields when present: script name/version, handler, execution model, colo/region, CPU time in ms, wall time in ms, TTFB in ms, outcome, and Ray ID. Preserve the full raw attribute maps. Missing fields should stay missing; zero is a valid timing value.
Add concise Workers-specific interpretation notes to MCP guidance:
- Zero-duration spans can result from the Workers clock advancing on I/O; they do not prove that no CPU work occurred.
- A trace ID in a log or response does not guarantee that spans were stored. Logs can retain IDs when tracing is disabled or a request is not sampled.
- The current
spanContext().traceFlagsvalue does not reflect head sampling and must not be used to construct downstreamtraceparentheaders. - Automatic trace-context propagation has limits; missing downstream spans do not prove that no downstream call occurred.
Relation to the latest Cloudflare update
The October 26, 2026 update adds spanContext(), setStatus(), and updateName(). It makes native custom spans easier to identify and interpret. The summary should retain the stored operation name and trace/span IDs so an agent can correlate an application-supplied ID with its renamed operation and Cloudflare context.
The requested Cloudflare summary builds on existing exported attributes. Those attributes predate this update. Generic single-span status exposure is tracked separately in #1873. This Cloudflare summary can be implemented independently.
References: Cloudflare custom-span API and limits, Maple's documented Workers caveats.
Acceptance criteria
- A native Workers span has a consistent Cloudflare summary in MCP and the web UI.
- Non-Cloudflare spans retain their current response; empty projected
cloudflare.*keys do not cause false detection. - Tests cover missing fields, zero timing values, and Cloudflare context supplied through span/resource attributes.
- A fixture with a renamed custom span retains its stored name and IDs through the MCP result.
- MCP guidance explains the clock, sampling, and propagation limits without claiming that sampling or a root cause can be determined from those fields alone.
Evidence: source and documentation inspection. A live Cloudflare-to-Maple export has not been tested for this report.
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 120
- 平均マージ
- 8時間 11分
- マージ済み PR(30日)
- 667
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
MapleTechLabs/maple のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
MapleTechLabs/maple#1921 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
MapleTechLabs/maple#1888 ·
メンテナーはふだん 1 日以内に返信
-
Alerting: Linear as a destination type, opening one issue per incident対応中かも @Makisuo が今日担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
MapleTechLabs/maple#1896 ·
メンテナーはふだん 1 日以内に返信
-
@maple-dev/alchemy: typed dashboard props, a managed refresh interval, and adopting a dashboard built in the UI対応中かも @jasonkuhrt が 2 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
MapleTechLabs/maple#1891 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
MapleTechLabs/maple#1873 ·
メンテナーはふだん 1 日以内に返信
MapleTechLabs/maple の issue をすべて見る
似ている issue
-
Parallel reticle_verify opens per-flow leases without the source lease's ignoreHTTPSErrors対応中かも @as992949791 が今日担当しました。 オープンgood first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
reticlehq/reticle#2033 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
area:quality p3-medium ready-for-agent type:docs
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
fderuiter/deruiter.dev#3589 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
manfredsteyer/angular-oauth2-oidc#1514 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
marmelab/react-admin#11431 ·
メンテナーはふだん 1 日以内に返信