GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(cloudflare): propagate tracing context through Queue messages by arthurfiorette · Pull Request #25306 · getsentry/sentry-javascript

Conversation

@arthurfiorette

@arthurfiorette arthurfiorette commented Oct 13, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This extends #22303, which was auto-closed for inactivity after its review comments slipped through my GitHub inbox. It is now synced with develop and addresses that review.


Adds opt-in trace propagation from Cloudflare Queue producers to consumers.

  • When a producer binding matches queueTracePropagationBindings, plain-object message bodies carry the producer's sentry-trace under __sentry_queue_trace__.
  • Arrays, binary payloads and other non-plain values are sent unchanged.
  • Consumers remove that field before invoking the application handler.
  • queue.process remains a root span and links to every distinct producer in the batch.

Span links are used instead of continuing a producer trace because a Queue batch can contain messages from unrelated traces. Picking one producer as the parent would create false causal relationships for the other messages.

Propagation is opt-in per binding because Cloudflare Queues has no message-header API. The SDK has to modify the message body, so consumers without Sentry would see the extra field.

Changes since #22303:

  • enableQueueTracePropagation: boolean became queueTracePropagationBindings, mirroring rpcTracePropagationBindings (feat(cloudflare)!: Replace enableRpcTracePropagation with rpcTracePropagationBindings #23486). Only the producer opts in, since it is the side that changes the payload. Consumers always strip and link, the same way RPC receivers handle __sentry_rpc_meta__.
  • Links no longer set sentry.link.type: previous_trace. A batch fans in producers rather than forming a previous/next chain.

Fixes #22309

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
arthurfiorette and others added 6 commits July 15, 2026 15:25
@arthurfiorette
code
0b05f24
@arthurfiorette
fix review comments
0bd582c
@arthurfiorette
fix reviews
fe0b730
@arthurfiorette
Merge branch 'develop' into arthurfiorette/queue-links
14ec356
@arthurfiorette @claude
Merge upstream/develop and address review comments
c905669
- Replace `enableQueueTracePropagation` with `queueTracePropagationBindings`, matching
  `rpcTracePropagationBindings`: producers opt in per binding, consumers always strip and link.
- Drop the `previous_trace` link type, a batch fans in producers rather than chaining traces.
- Strip the carrier with `Reflect.deleteProperty` on the shared key so frozen bodies cannot throw.
- Compute the publish body size once when propagation is enabled.
- Move the queue integration assertions to span streaming.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@arthurfiorette @claude
chore: Add CHANGELOG entry for queue trace propagation
86f1224
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the external PR from an external contributor label Oct 13, 2026
@arthurfiorette
arthurfiorette marked this pull request as ready for review October 13, 2026 03:47
@arthurfiorette
arthurfiorette requested a review from a team as a code owner October 13, 2026 03:47
@arthurfiorette
arthurfiorette requested review from JPeer264 and mydea and removed request for a team October 13, 2026 03:47
@Lms24

Lms24 commented Oct 13, 2026

Copy link
Copy Markdown
Member

HI @arthurfiorette thanks for opening another PR for this! I'll leave the review up to @JPeer264 who has more context on the cloudflare specific details.

Good idea to use span links. I think we should still set the sentry.link.type link attribute, but probably with the message_origin value as proposed here https://github.com/getsentry/sentry-javascript/pull/21777/changes#r4227878655. Unfortunately, that PR is not yet merged so we have to wait a bit for the final link type value. Shouldn't stop the rest of the review though :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arthurfiorette
Merge remote-tracking branch 'upstream/develop' into arthurfiorette/q…
c783df9
…ueue-links

# Conflicts:
#	CHANGELOG.md
@JPeer264

JPeer264 commented Oct 15, 2026

Copy link
Copy Markdown
Member

I'll wait on reviewing that PR until #21777 is finished. In that PR is an open point on how we deal with span links for queues. This might be then also relevant for this PR. I think by mid next week I can start reviewing this. Hope the timeline is ok for you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

👋 @mydea, @JPeer264 — Please review this PR when you get a chance!

arthurfiorette reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264
JPeer264 removed the request for review from mydea October 20, 2026 10:23
JPeer264
JPeer264 reviewed Oct 20, 2026
View reviewed changes

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a comment here, so the bot isn't creating a false positive.

I'm still working on #21777 to finalize (it is soon ready, just need to polish some things) - then I can review this PR properly

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

arthurfiorette reacted with heart emoji
All reactions
  • ❤️ 1 reaction
JPeer264
JPeer264 requested changes Oct 24, 2026
View reviewed changes

@JPeer264 JPeer264 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that it took a while, but I was finally able to finish of the remaining work of the other PR, that blocked this PR.

It is good that we add a new queueTracePropagationBindings option, since the current one is only focusing on rpc (I originally thought of having a one size fits all option, but I don't think that would have been a good idea).

I added some comments, so please take a look at them. The rest of the code looks good, great work - thank you.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread CHANGELOG.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/cloudflare/src/instrumentations/worker/instrumentQueue.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/cloudflare/src/instrumentations/worker/instrumentQueue.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/cloudflare/src/utils/queueTraceMeta.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread packages/cloudflare/src/client.ts
* );
* ```
*/
queueTracePropagationBindings?: TracePropagationTargets;

@JPeer264 JPeer264 Oct 23, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note to myself. We might need to extend this in our Vite plugin to automatically add these in case they're in the same deployment

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/cloudflare/src/utils/bindingPropagation.ts
@@ -1,18 +1,14 @@
import { matchesTracePropagationTargets } from '@sentry/core';
import { matchesTracePropagationTargets, type TracePropagationTargets } from '@sentry/core';

@JPeer264 JPeer264 Oct 24, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super low priority. Technically this file is doing more now than just rpcPropagation , so we could rename it to something more generic, but not a must. You can decide as you see fit.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
arthurfiorette added 2 commits October 31, 2026 14:50
@arthurfiorette
Merge remote-tracking branch 'upstream/develop' into arthurfiorette/q…
3468c05
…ueue-links

# Conflicts:
#	CHANGELOG.md
#	packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts
#	packages/cloudflare/test/instrumentations/instrumentEnv.test.ts
@arthurfiorette
review comment
27dd16c
cursor[bot]
cursor Bot reviewed Oct 31, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 27dd16c. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread packages/cloudflare/test/instrumentations/worker/instrumentQueue.test.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@arthurfiorette
remove hardcode comments
ae7138a
@arthurfiorette

arthurfiorette commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Review comments fixed @JPeer264!

JPeer264 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JPeer264
JPeer264 approved these changes Nov 9, 2026
View reviewed changes
@JPeer264

JPeer264 commented Nov 9, 2026

Copy link
Copy Markdown
Member

Amazing. Thanks a lot for your work

arthurfiorette reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@JPeer264
JPeer264 merged commit 7259f5d into getsentry:develop Nov 9, 2026
160 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@javascript-sdk-gitflow javascript-sdk-gitflow Bot mentioned this pull request Nov 9, 2026
chore: Add external contributor to CHANGELOG.md #26214
Merged
JPeer264 added a commit that referenced this pull request Nov 9, 2026
@javascript-sdk-gitflow @JPeer264
chore: Add external contributor to CHANGELOG.md (#26214)
b80191e
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #25306

Co-authored-by: JPeer264 <[email protected]>
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Nov 10, 2026
publish: getsentry/[email protected] getsentry/publish#10343
Closed
51 tasks done
@github-actions github-actions Bot mentioned this pull request Nov 10, 2026
Cloudflare Queue context propagation and trace links #22309
Closed
@sentry-junior sentry-junior Bot mentioned this pull request Nov 10, 2026
docs(cloudflare): Document Queue trace propagation getsentry/sentry-docs#20692
Merged
1 of 6 tasks
JPeer264 added a commit to getsentry/sentry-docs that referenced this pull request Nov 17, 2026
@sentry-junior @JPeer264
docs(cloudflare): Document Queue trace propagation (#20692)
13a524c
## DESCRIBE YOUR PR

This PR documents the new `queueTracePropagationBindings` option in
`@sentry/cloudflare` 11.12.0
([getsentry/sentry-javascript#25306](getsentry/sentry-javascript#25306),
closes
[getsentry/sentry-javascript#22309](getsentry/sentry-javascript#22309)).
The option connects Cloudflare Queue consumers to the producers that
sent their messages.

- **Distributed tracing (Cloudflare):** Adds a new "Queue Trace
Propagation" section. It covers how to opt in per producer binding, that
only plain-object bodies carry the `__sentry_queue_trace__` field, that
consumers remove the field automatically, and why `queue.process` links
to each producer instead of continuing one producer's trace. It also
includes a warning about consumers that don't run Sentry and about the
roughly 80 extra bytes per message against the 128 KB limit.
- **Options:** Adds a `queueTracePropagationBindings` `SdkOption` next
to `rpcTracePropagationBindings`, available since 11.12.0.
- **Bindings:** Adds a pointer from the Queues binding to the new
section.

All wording is based on the option's JSDoc and the implementation in
that PR. It does not say the Vite plugin derives queue bindings, because
the PR doesn't add that.

## IS YOUR CHANGE URGENT?

- [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD
- [ ] Other deadline: YYYY-MM-DD
- [x] No deadline: Not urgent, can wait up to 1 week+

## PRE-MERGE CHECKLIST

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

<!-- junior-request-attribution:start -->
via **Jan Peer Stöcklmair**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0CA6TD3QRK%3A1794327747.615899 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0CA6TD3QRK%3A1794327747.615899)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0CA6TD3QRK%3A1794327747.615899/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Jan Peer Stöcklmair <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@JPeer264 JPeer264 JPeer264 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

external PR from an external contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cloudflare Queue context propagation and trace links

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@arthurfiorette @Lms24 @JPeer264
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.