Skip to content

Add preview metadata to buffered tail traces#6375

Merged
ketanhwr merged 1 commit intocloudflare:mainfrom
Ankcorn:tankcorn/preview-observability
Mar 30, 2026
Merged

Add preview metadata to buffered tail traces#6375
ketanhwr merged 1 commit intocloudflare:mainfrom
Ankcorn:tankcorn/preview-observability

Conversation

@Ankcorn
Copy link
Copy Markdown
Member

@Ankcorn Ankcorn commented Mar 20, 2026

Summary

Add preview metadata to buffered tail traces.

This exposes:

  trace.preview = { id, slug, name }

to classic/buffered tail workers.

Why Why

edgeworker needs to surface pipeline-level preview identity in classic tail worker
observability.

That requires workerd to support carrying preview metadata through the buffered trace path;
otherwise classic tail workers only receive traces without any preview context.

Changes

  • add top-level preview field to rpc::Trace
  • add in-memory TracePreview
  • serialize / deserialize it through io/trace.*
  • expose it on the JS buffered tail trace API as trace.preview
  • add a focused round-trip trace test

Notes

This only adds the workerd support layer. The corresponding edgeworker change is what populates
this field from pipeline preview metadata.

@Ankcorn Ankcorn requested review from a team as code owners March 20, 2026 17:18
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Ankcorn Ankcorn force-pushed the tankcorn/preview-observability branch from fb12ef3 to 4dddab3 Compare March 25, 2026 09:57
@Ankcorn
Copy link
Copy Markdown
Member Author

Ankcorn commented Mar 25, 2026

I have read the CLA Document and I hereby sign the CLA

@Ankcorn
Copy link
Copy Markdown
Member Author

Ankcorn commented Mar 25, 2026

recheck

github-actions bot added a commit that referenced this pull request Mar 25, 2026
@Ankcorn Ankcorn requested a review from jp4a50 March 25, 2026 10:33
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 27, 2026

Merging this PR will improve performance by 25.64%

⚠️ 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
✅ 69 untouched benchmarks
⏩ 129 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
bodyWithHeaders[Response] 38.7 µs 30.8 µs +25.64%

Comparing Ankcorn:tankcorn/preview-observability (35cc683) with main (ecfaecd)

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.

@Ankcorn Ankcorn force-pushed the tankcorn/preview-observability branch from 827d7da to 5533538 Compare March 27, 2026 20:15
@Ankcorn Ankcorn requested a review from a team as a code owner March 27, 2026 20:18
@Ankcorn Ankcorn requested a review from jamesopstad March 27, 2026 20:18
@Ankcorn Ankcorn force-pushed the tankcorn/preview-observability branch 3 times, most recently from 4c9390f to 19ceb82 Compare March 30, 2026 09:35
@Ankcorn Ankcorn force-pushed the tankcorn/preview-observability branch from 19ceb82 to feefba4 Compare March 30, 2026 10:17
@Ankcorn Ankcorn requested a review from petebacondarwin March 30, 2026 10:18
@Ankcorn Ankcorn force-pushed the tankcorn/preview-observability branch 6 times, most recently from 5a3549e to 76c1ced Compare March 30, 2026 13:20
@Ankcorn Ankcorn force-pushed the tankcorn/preview-observability branch from 76c1ced to 35cc683 Compare March 30, 2026 13:41
@ketanhwr ketanhwr merged commit f7c0709 into cloudflare:main Mar 30, 2026
29 of 32 checks passed
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.

5 participants