Files
vercel__workflow/.changeset/stream-write-flush-span.md
Karthik Kalyan 4a43e39fec telemetry: stream flush span + otel load diagnostics (#2891)
* telemetry: emit client-observed workflow.stream.write span per flush batch

Complements the existing workflow.stream.read TTFC span: each flushed
batch emits a back-dated CLIENT span covering the app-perceived write
latency (buffer dwell + RPC), with buffer_dwell_ms / chunks / bytes
attributes so client-side batching cost (flush timer, turbo run-ready
barrier) can be told apart from network/server time. Failed flushes
keep the batch's original t0 so a retried batch reports its full dwell.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: tighten changeset

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* telemetry: rename flush span to workflow.stream.flush; DEBUG-log world-vercel OTEL load failure

- workflow.stream.write is taken by world-vercel's per-request RPC span
  (#2857, chunk_rtt); the per-batch flush span gets its own name so the
  two stay distinguishable in trace queries. Attributes move to
  workflow.stream.flush.{buffer_dwell_ms,chunks,bytes}, operation=flush.
- world-vercel's @opentelemetry/api load failure was silently latched as
  null, which also swallows bundler/resolution failures in apps that DO
  register a tracer (observed in production: workbench apps emit core
  spans but none of world-vercel's). Log the reason under
  DEBUG=workflow:* so the failure mode is diagnosable.
- Document workflow.stream.flush in the tracing docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore: tighten changeset

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 09:58:05 -07:00

325 B

@workflow/core, @workflow/world-vercel
@workflow/core @workflow/world-vercel
patch patch

Emit a client-observed workflow.stream.flush span per stream-write batch, with a buffer_dwell_ms attribute separating client-side batching cost from network/server time. Log under DEBUG=workflow:* when @opentelemetry/api fails to load in world-vercel.