Skip to content

test(cloudflare): Assert Workers AI gen_ai spans in the send-to-sentry E2E test - #24515

Open
JPeer264 wants to merge 1 commit into
jp/test-utils-fetch-span-attributesfrom
jp/cloudflare-send-to-sentry-workers-ai
Open

JPeer264 wants to merge 1 commit into
jp/test-utils-fetch-span-attributesfrom
jp/cloudflare-send-to-sentry-workers-ai

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 18, 2026 •

Copy link
Copy Markdown
Member

closes #24759

Adds a Workers AI call to the real-Worker E2E app and checks that the gen_ai.chat span reaches Sentry with gen_ai.input.messages and gen_ai.output.messages. The unit and integration tests only see the envelope, so this is the first check that the Workers AI span and its attributes survive ingestion.

The test expects gen_ai.output.messages and not gen_ai.response.text, because Sentry stores the SDK's gen_ai.response.text under that name. It uses @cf/meta/llama-3.2-1b-instruct with max_tokens: 5 to keep the Workers AI cost of each run small.

🤖 Generated with Claude Code

@JPeer264
JPeer264 added this pull request to stack #24516 September 18, 2026 18:47
@JPeer264
JPeer264 marked this pull request as ready for review September 18, 2026 18:49
@JPeer264 JPeer264 self-assigned this Sep 18, 2026
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31 kB - -
@sentry/react (incl. Tracing) 53.45 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 30.93 kB - -
CDN Bundle (incl. Tracing) 51.69 kB - -
CDN Bundle (incl. Logs, Metrics) 33.2 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.92 kB - -
CDN Bundle (incl. Tracing, Replay) 89.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.45 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.42 kB - -
CDN Bundle - uncompressed 91.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 153.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.73 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.54 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.5 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.13 kB - -
@sentry/nextjs (client) 55.77 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.95 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 137.13 kB +0.01% +9 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.8 kB - -
@sentry/node - without tracing 90.73 kB +0.02% +11 B 🔺
@sentry/node - without channel injection 115.5 kB +0.01% +10 B 🔺
@sentry/aws-serverless 99 kB +0.01% +9 B 🔺
@sentry/cloudflare (withSentry) - minified 206.62 kB - -
@sentry/cloudflare (withSentry) 514.02 kB - -

View base workflow run

@JPeer264

Copy link
Copy Markdown
Member Author

FYI the tests fail but will run again with: #24560

@github-actions

Copy link
Copy Markdown
Contributor

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

@JPeer264
JPeer264 force-pushed the jp/cloudflare-send-to-sentry-workers-ai branch from cbe84cb to bb7f340 Compare September 28, 2026 08:00
…y E2E test

Call a Workers AI model from the deployed Worker and check that the
gen_ai.chat span reaches Sentry with its input and output messages.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/cloudflare-send-to-sentry-workers-ai branch from bb7f340 to 5b205b2 Compare September 28, 2026 09:18

This branch has not been deployed

No deployments
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.

Add realistic e2e test app for Workers AI

1 participant