Cloudflare Workers adds spanContext, setStatus and updateName tracing APIs

irvinebroque · x · 2026-10-27

Cloudflare added three OpenTelemetry span methods to Workers: spanContext() returns traceId/spanId/traceFlags matching exported traces for request correlation; setStatus() marks spans unset/ok/error with an optional error message included in exported traces (not yet in the dashboard); updateName() renames spans after start, e.g. once a route matches, including the invocation root span from tracing.getActiveSpan(). The changelog ships full JS/TS examples showing error handling and returning traceId in 500 responses—all zero-dependency.

Original post →

More from Infra

Infra channel →