diff --git a/src/assets/images/workers/changelog/jsrpc-session-spans.png b/src/assets/images/workers/changelog/jsrpc-session-spans.png new file mode 100644 index 00000000000..0e4d95ad831 Binary files /dev/null and b/src/assets/images/workers/changelog/jsrpc-session-spans.png differ diff --git a/src/content/changelog/workers/2026-09-10-javascript-rpc-session-spans.mdx b/src/content/changelog/workers/2026-09-10-javascript-rpc-session-spans.mdx new file mode 100644 index 00000000000..a6440a536de --- /dev/null +++ b/src/content/changelog/workers/2026-09-10-javascript-rpc-session-spans.mdx @@ -0,0 +1,16 @@ +--- +title: Workers traces now include JavaScript RPC session spans +description: Workers traces now include JavaScript RPC session spans for Worker-to-Worker and Worker-to-Durable Object calls. +products: + - workers + - durable-objects +date: 2026-09-10 +--- + +Workers traces can now follow JavaScript RPC calls across Worker boundaries and into Durable Objects. Previously, a trace stopped at the caller's RPC boundary. The dashboard now shows the caller-side session and method calls alongside the callee invocation, nested calls, and callbacks into another Worker. + +A session span covers the lifetime of a caller-side session and groups calls that reuse it. Individual call spans show each method invocation. Execution colors distinguish the Workers or Durable Object entrypoints involved, while arrows mark outgoing and incoming calls. Together, these details show where time was spent, which calls reused a session, and how returned stubs and callbacks fit into the request. + +![A Workers trace of a Worker-to-Worker RPC session, showing the session span, the caller's getCounter and increment call spans, and the callee's invocation and matching call spans](~/assets/images/workers/changelog/jsrpc-session-spans.png) + +[Tracing must be enabled](/workers/observability/traces/#how-to-enable-tracing) in your Wrangler configuration for these spans to be recorded. For supported spans and attributes, refer to [Spans and attributes](/workers/observability/traces/spans-and-attributes/). diff --git a/src/content/docs/workers/observability/traces/spans-and-attributes.mdx b/src/content/docs/workers/observability/traces/spans-and-attributes.mdx index a3141c936f2..eb016985210 100644 --- a/src/content/docs/workers/observability/traces/spans-and-attributes.mdx +++ b/src/content/docs/workers/observability/traces/spans-and-attributes.mdx @@ -147,6 +147,8 @@ Cloudflare Workers provides automatic tracing instrumentation **out of the box** #### [`RPC Handler`](/workers/runtime-apis/rpc/) +RPC traces include caller-side session spans and individual method-call spans. These spans cover Worker-to-Worker and Worker-to-Durable Object calls. + - `cloudflare.jsrpc.method` #### [`Email Handler`](/email-service/api/route-emails/email-handler/)