MCP: expose span status and status message in inspect_span
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- api, observability
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 1.8k
- Fork
- 120
- Merge medio
- 8h 11m
- PR unite (30g)
- 667
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MapleTechLabs/maple
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MapleTechLabs/maple#1921 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
MapleTechLabs/maple#1888 ·
I maintainer di solito rispondono entro 1 giorno
-
Alerting: Linear as a destination type, opening one issue per incidentForse già presa @Makisuo l’ha presa 1 giorno fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
MapleTechLabs/maple#1896 ·
I maintainer di solito rispondono entro 1 giorno
-
@maple-dev/alchemy: typed dashboard props, a managed refresh interval, and adopting a dashboard built in the UIForse già presa @jasonkuhrt l’ha presa 3 giorni fa. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 18/100
MapleTechLabs/maple#1891 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
MapleTechLabs/maple#1874 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MapleTechLabs/maple
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
better-auth/better-auth#12132 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hurttlocker/o8#5112 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
webrecorder/wabac.js#386 ·
-
needs-triage
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
agent-of-empires/agent-of-empires#5098 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno