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 — test(cloudflare): Add Flue E2E test that deploys a real Worker and sends to Sentry by JPeer264 · Pull Request #24816 · getsentry/sentry-javascript

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 29, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Adds cloudflare-flue-send-to-sentry. It deploys a Flue agent as a real Worker, runs real model turns through OpenRouter, and checks through the sentry CLI that the gen_ai spans and a tool error arrive in Sentry. It replaces cloudflare-flue, which ran the same agent locally behind the event proxy. The app has no instrument() call, so it still proves that @sentry/cloudflare/vite registers the Flue instrumentation at build time.

To protect unwanted calls from outside anyone from our public workers a E2E_TEST_WORKER_TOKEN has been added which is automatically added to each deployment (see #24816 (comment))

Flue runs the turn from a Durable Object alarm, and the SDK starts a new trace for each alarm. So the test cannot send the trace id with its request, as the other send-to-sentry tests do. It reads the conversation id back from Flue and finds the trace by gen_ai.conversation.id through the events API (new findTraceIdOfSpan), because sentry span list returns no trace id for a project search.

The CLI now runs with SENTRY_NO_CACHE=1. sentry api caches GET responses and has no --fresh flag, so without it every poll got the first empty answer again.

Checks that go away with cloudflare-flue on Cloudflare: the span attributes (origin, provider, token usage), the manual span under the tool span, and the dataloader span that orchestrion adds at build time. node-flue still has them on Node. The CLI trace view drops span attributes, so the attribute checks need fetchSpanAttributes from #24514 first.

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

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

RulaKhaled reacted with eyes emoji
All reactions
  • 👀 1 reaction
@JPeer264
JPeer264 added this pull request to stack #24817 September 29, 2026 08:43
@github-actions

github-actions Bot commented Sep 29, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.36 kB - -
@sentry/browser - with treeshaking flags 27.65 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.54 kB - -
@sentry/browser (incl. Tracing) 51.3 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.32 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.31 kB - -
@sentry/browser (incl. Tracing, Replay) 90.89 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.99 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.58 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.57 kB - -
@sentry/browser (incl. Feedback) 46.88 kB - -
@sentry/browser (incl. sendFeedback) 34.43 kB - -
@sentry/browser (incl. FeedbackAsync) 39.54 kB - -
@sentry/browser (incl. Metrics) 30.38 kB - -
@sentry/browser (incl. Logs) 30.66 kB - -
@sentry/browser (incl. Metrics & Logs) 31.33 kB - -
@sentry/react 31.2 kB - -
@sentry/react (incl. Tracing) 53.67 kB - -
@sentry/vue 36.9 kB - -
@sentry/vue (incl. Tracing) 53.88 kB - -
@sentry/svelte 29.39 kB - -
CDN Bundle 31.18 kB - -
CDN Bundle (incl. Tracing) 51.95 kB - -
CDN Bundle (incl. Logs, Metrics) 33.43 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.89 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.16 kB - -
CDN Bundle (incl. Tracing, Replay) 89.52 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.5 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.7 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.67 kB - -
CDN Bundle - uncompressed 92.05 kB - -
CDN Bundle (incl. Tracing) - uncompressed 154.44 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 98.62 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 160.39 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 228.19 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 274.17 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 280.1 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.87 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.8 kB - -
@sentry/nextjs (client) 55.91 kB - -
@sentry/sveltekit (client) 51.74 kB - -
@sentry/core/server 39.99 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 144.32 kB +0.01% +12 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.01 kB - -
@sentry/node - without tracing 92.96 kB +0.02% +10 B 🔺
@sentry/node - without channel injection 122.66 kB +0.02% +13 B 🔺
@sentry/aws-serverless 101.26 kB +0.01% +8 B 🔺
@sentry/cloudflare (withSentry) - minified 206.69 kB - -
@sentry/cloudflare (withSentry) 514.13 kB - -

View base workflow run

All reactions

Sorry, something went wrong.

Uh oh!

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

sentry-warden[bot]
sentry-warden Bot reviewed Sep 29, 2026
View reviewed changes
Comment thread dev-packages/e2e-tests/test-applications/cloudflare-flue-send-to-sentry/global-setup.ts Resolved

Uh oh!

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

@JPeer264
JPeer264 marked this pull request as ready for review September 29, 2026 13:11
@JPeer264
JPeer264 requested review from RulaKhaled and andreiborza September 29, 2026 13:11
@JPeer264 JPeer264 self-assigned this Sep 29, 2026
Base automatically changed from jp/test-utils-cloudflare-helpers to develop September 29, 2026 15:17
@JPeer264
JPeer264 force-pushed the jp/cloudflare-send-to-sentry-more-e2e branch from c1a82e2 to 360c698 Compare September 30, 2026 11:43
RulaKhaled
RulaKhaled approved these changes Sep 30, 2026
View reviewed changes

@RulaKhaled RulaKhaled left a comment

Copy link
Copy Markdown
Collaborator

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.

looks good. one thing: the PR description is stale, the last paragraph says the attribute checks, the manual-span nesting and the dataloader check go away pending fetchSpanAttributes from #24514. that helper is on develop already and all three are asserted in the tests here, so worth updating before the squash

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread dev-packages/e2e-tests/test-applications/cloudflare-flue-send-to-sentry/wrangler.jsonc Outdated
{
"$schema": "./node_modules/wrangler/config-schema.json",
// Placeholder only: every test run deploys under a unique name, see global-setup.ts.
"name": "cloudflare-flue",

@RulaKhaled RulaKhaled Sep 30, 2026

Copy link
Copy Markdown
Collaborator

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.

l: rename the placeholder to match the directory

Sorry, something went wrong.

Uh oh!

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

All reactions

@JPeer264 JPeer264 Oct 1, 2026

Copy link
Copy Markdown
Member Author

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.

done in dcb678c (this PR)

Sorry, something went wrong.

Uh oh!

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

All reactions
@JPeer264
JPeer264 force-pushed the jp/cloudflare-send-to-sentry-more-e2e branch from 360c698 to 2fff275 Compare September 30, 2026 14:25
JPeer264 and others added 7 commits October 1, 2026 11:50
@JPeer264 @claude
test(cloudflare): Add Flue E2E test that deploys a real Worker and se…
784f6e8
…nds to Sentry

cloudflare-flue-send-to-sentry deploys a Flue agent as a real Worker, runs
real model turns, and polls the E2E project through the sentry CLI. It is
optional, like the other apps that need the Cloudflare secrets. It replaces
cloudflare-flue, which ran the same agent locally behind the event proxy.

Flue runs the turn from a Durable Object alarm, and the SDK starts a new trace
for each alarm, so the test cannot send the trace id with the request. It
reads the conversation id from Flue and finds the trace by
`gen_ai.conversation.id` through the events API (`findTraceIdOfSpan`),
because `sentry span list` returns no trace id for a project search.

`sentry api` caches GET responses and has no `--fresh` flag, so the CLI now
runs with `SENTRY_NO_CACHE=1`. Without it, every poll got the first empty
answer again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JPeer264 @claude
fixup! test(cloudflare): Add Flue E2E test that deploys a real Worker…
3fb8786
… and sends to Sentry

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JPeer264 @claude
fixup! test(cloudflare): Add Flue E2E test that deploys a real Worker…
d3f27bf
… and sends to Sentry

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JPeer264 @claude
fixup! test(cloudflare): Add Flue E2E test that deploys a real Worker…
0e5e23f
… and sends to Sentry

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JPeer264 @claude
fixup! test(cloudflare): Add Flue E2E test that deploys a real Worker…
8ac8710
… and sends to Sentry

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JPeer264 @claude
fixup! test(cloudflare): Add Flue E2E test that deploys a real Worker…
0fc7d8f
… and sends to Sentry

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JPeer264 @claude
fixup! test(cloudflare): Add Flue E2E test that deploys a real Worker…
dcb678c
… and sends to Sentry

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@JPeer264
JPeer264 force-pushed the jp/cloudflare-send-to-sentry-more-e2e branch from d6498f5 to dcb678c Compare October 1, 2026 09:50
sentry[bot]
sentry Bot reviewed Oct 1, 2026
View reviewed changes
Comment thread dev-packages/e2e-tests/test-applications/cloudflare-flue-send-to-sentry/src/agents/hello.ts
Comment on lines +20 to +22
run: ({ data }) =>
Sentry.startSpan({ name: 'resolve-weather', attributes: { 'weather.source': 'static-table' } }, () => {
return `It is 21 degrees and sunny in ${city}.`;
return `It is 21 degrees and sunny in ${data.city}.`;

@sentry sentry Bot Oct 1, 2026

Copy link
Copy Markdown
Contributor

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.

Bug: The run callback for the get_weather tool incorrectly destructures its input as ({ data }) instead of ({ city }), which will cause a TypeError at runtime.
Severity: HIGH

Suggested Fix

Change the parameter destructuring in the run callback from ({ data }) => ... data.city to ({ city }) => ... city. This aligns the function signature with the tool's input definition and prevents the runtime error.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
dev-packages/e2e-tests/test-applications/cloudflare-flue-send-to-sentry/src/agents/hello.ts#L20-L22

Potential issue: The `run` callback for the `get_weather` tool in `hello.ts`
destructures its input as `({ data })` and then accesses `data.city`. However, the
tool's input schema is defined as `v.object({ city: v.string() })`, and the runtime
passes the arguments directly, not nested within a `data` object. This mismatch will
cause the `data` parameter to be `undefined`, leading to a `TypeError` when `data.city`
is accessed. This will cause the E2E tests, which explicitly invoke this tool, to fail.

Did we get this right? 👍 / 👎 to inform future reviews.

Sorry, something went wrong.

Uh oh!

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

All reactions
@JPeer264
JPeer264 merged commit db0854e into develop Oct 1, 2026
683 of 686 checks passed

Uh oh!

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

@JPeer264
JPeer264 deleted the jp/cloudflare-send-to-sentry-more-e2e branch October 1, 2026 12:10
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Oct 2, 2026
publish: getsentry/[email protected] getsentry/publish#9753
Closed
47 tasks
@RulaKhaled RulaKhaled mentioned this pull request Oct 20, 2026
test(e2e): Add node-flue-send-to-sentry test app #25550
Merged
RulaKhaled added a commit that referenced this pull request Oct 28, 2026
@RulaKhaled @claude
test(e2e): Add node-flue-send-to-sentry test app (#25550)
5074c24
An e2e app that uses the Flue integration the way a user does and sends
the data to a real Sentry project, per #24753. Cloudflare already has
one (`cloudflare-flue-send-to-sentry`, #24816), so this covers Node.

**Stacked on #25549.** Without that fix every turn after the first lands
in the first request's trace, which these tests catch. This PR targets
its branch and retargets to `develop` once it merges.

**The app.** A built Flue server, with `Sentry.init` imported first and
`@sentry/node/import` preloaded, runs real tool-calling turns through
OpenRouter. The router answers `202` before a turn runs, so the tests
find each trace by the `gen_ai.conversation.id` Flue reports back, as
the Cloudflare app does. `@flue/runtime` is pinned to 2.0.5 like
`node-flue`, with a `(latest)` variant. `hello.ts` is a `'use agent'`
module, so `@flue/vite` binds its identity at build time, which the
integration suite cannot reproduce.

**`node-flue`** now checks that each turn sits under the request that
sent it. Its weather tool also reads `({ data })`, the way Flue 2 passes
tool input, so it stops answering "sunny in undefined".

Closes #24753

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@sentry sentry[bot] sentry[bot] left review comments
@sentry-warden sentry-warden[bot] sentry-warden[bot] left review comments
@RulaKhaled RulaKhaled RulaKhaled approved these changes
@andreiborza andreiborza Awaiting requested review from andreiborza

Uh oh!

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

Assignees

@JPeer264 JPeer264

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

2 participants

@JPeer264 @RulaKhaled
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.