Skip to content

emit per-call jsRpcCall spans and propagate stub origin for trace continuity - #7006

Merged
apeacock1991 merged 3 commits into
mainfrom
apeacock/jsrpcTracing-gitlab
Aug 14, 2026
Merged

emit per-call jsRpcCall spans and propagate stub origin for trace continuity#7006
apeacock1991 merged 3 commits into
mainfrom
apeacock/jsrpcTracing-gitlab

Conversation

@apeacock1991

Copy link
Copy Markdown
Contributor

Imported from #6750. Dupe of #6966 but named correctly (branch matching internal).

Summary

Add per-call tracing for JavaScript RPC.

Changes

  • Emit jsRpcCall spans on both caller and callee.
  • Tag spans with the RPC method, operation, and target kind.
  • Parent the callee onset to the call that opened the session.
  • Add jsrpc.caller_span_id to correlate each callee dispatch with its caller.
  • Preserve tracing relationships for pipelined calls, returned stubs/promises, and callbacks.
  • Avoid retaining span state on untraced paths.

Testing

  • Added streaming-tail tests for pipelined RPC calls.
  • Added coverage for callback argument tracing.
  • Updated existing tail-worker tracing expectations.

Screenshots

image

@apeacock1991
apeacock1991 requested review from a team as code owners August 14, 2026 12:43
@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

2 similar comments
@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

@apeacock1991 Bonk workflow failed. Check the logs for details.

View workflow run · To retry, trigger Bonk again.

@codspeed-hq

codspeed-hq Bot commented Aug 14, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 1.97%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 70 untouched benchmarks
⏩ 129 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
JsString_Utf8Length_Utf16_Invalid_NonFlat_256 9.4 µs 10.7 µs -12.74%
bm_Promise_Fib10 20.3 µs 18.5 µs +10.12%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing apeacock/jsrpcTracing-gitlab (fca229f) with main (c15dd17)

Open in CodSpeed

Footnotes

  1. 129 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

5 similar comments
@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

@ask-bonk

ask-bonk Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

APIError: Invalid Anthropic API Key

github run

JSRPC promises and returned stubs retained span parents directly on
JavaScript heap objects. Process sandbox span observers own Cap’n Proto
clients tied to the request I/O context, causing a use-after-free when
the objects are collected after request teardown.

Store retained span parents through IoOwn so they are destroyed with
their owning context.
@apeacock1991
apeacock1991 merged commit 02f9e0f into main Aug 14, 2026
22 of 23 checks passed
@apeacock1991
apeacock1991 deleted the apeacock/jsrpcTracing-gitlab branch August 14, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants