Sitelet https://github.com/getsentry/sentry-javascript/pull/25028
Skip to content

feat(cloudflare): Skip spans for the pi_ tables of PiHarness - #25028

Merged
JPeer264 merged 1 commit into
jp/pi-durable-e2efrom
jp/cloudflare-skip-pi-tables
Oct 8, 2026
Merged

JPeer264 merged 1 commit into
jp/pi-durable-e2efrom
jp/cloudflare-skip-pi-tables

Conversation

@JPeer264

@JPeer264 JPeer264 commented Oct 5, 2026

Copy link
Copy Markdown
Member

The Agents SDK PiHarness (changelog) keeps the state of pi-durable in the SQLite database of the Durable Object, in tables with the pi_ prefix of its session store. Each statement became a db.query span: one run with one tool call had 189 of them next to its 7 agent spans, and the request that submitted the prompt had 120 more. These statements are framework bookkeeping, like the ones on the cf_ tables of agents, so they are now skipped the same way, and durableObjectSqlSpanAllowlist: [/^pi_/] brings them back.

The cost is the same as for cf_: a user table whose name starts with pi_ also loses its spans until it is on the allowlist. Names such as api_keys or pipelines are not affected.

Before: 196 spans, after: 7 spans for the same prompt.

🤖 Generated with Claude Code

@JPeer264
JPeer264 added this pull request to stack #25029 October 5, 2026 07:22
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.8 kB - -
@sentry/browser - with treeshaking flags 27.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.84 kB - -
@sentry/browser (incl. Tracing) 51.85 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.87 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.8 kB - -
@sentry/browser (incl. Tracing, Replay) 91.58 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 80.45 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 96.29 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 109.27 kB - -
@sentry/browser (incl. Feedback) 47.32 kB - -
@sentry/browser (incl. sendFeedback) 34.84 kB - -
@sentry/browser (incl. FeedbackAsync) 39.95 kB - -
@sentry/browser (incl. Metrics) 30.82 kB - -
@sentry/browser (incl. Logs) 31.11 kB - -
@sentry/browser (incl. Metrics & Logs) 31.75 kB - -
@sentry/react 31.63 kB - -
@sentry/react (incl. Tracing) 54.17 kB - -
@sentry/vue 37.84 kB - -
@sentry/vue (incl. Tracing) 54.78 kB - -
@sentry/svelte 29.83 kB - -
@sentry/remix (Remix 3 client bundle) 56.83 kB - -
CDN Bundle 31.53 kB - -
CDN Bundle (incl. Tracing) 52.34 kB - -
CDN Bundle (incl. Logs, Metrics) 33.72 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 54.3 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 74.65 kB - -
CDN Bundle (incl. Tracing, Replay) 90.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 96.17 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 98.15 kB - -
CDN Bundle - uncompressed 92.92 kB - -
CDN Bundle (incl. Tracing) - uncompressed 155.46 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 99.46 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 161.41 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 229.5 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 275.63 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 281.57 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 289.33 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 295.26 kB - -
@sentry/nextjs (client) 56.53 kB - -
@sentry/sveltekit (client) 52.23 kB - -
@sentry/core/server 40.86 kB - -
@sentry/core/browser 13.71 kB - -
@sentry/node 149.8 kB +2.69% +3.92 kB 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 83.48 kB +0.18% +150 B 🔺
@sentry/node - without tracing 93.88 kB +0.21% +196 B 🔺
@sentry/node - without channel injection 127.97 kB +3.18% +3.94 kB 🔺
@sentry/aws-serverless 102.05 kB +0.15% +149 B 🔺
@sentry/cloudflare (withSentry) - minified 209.75 kB +0.02% +40 B 🔺
@sentry/cloudflare (withSentry) 520.07 kB +0.03% +129 B 🔺

View base workflow run

@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch from ef92609 to 8e25d1f Compare October 5, 2026 09:44
@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch from 8e25d1f to 08ac2af Compare October 5, 2026 11:22
@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch from 08ac2af to ecd24b7 Compare October 5, 2026 12:39
@JPeer264
JPeer264 marked this pull request as ready for review October 5, 2026 12:40
@JPeer264
JPeer264 requested a review from a team as a code owner October 5, 2026 12:40
@JPeer264
JPeer264 requested review from isaacs and mydea and removed request for a team October 5, 2026 12:40
@JPeer264 JPeer264 self-assigned this Oct 5, 2026
@JPeer264
JPeer264 requested a review from andreiborza October 5, 2026 12:40
@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch from ecd24b7 to 5f53090 Compare October 5, 2026 12:53
@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch 2 times, most recently from 6029c84 to 1f1d4d4 Compare October 6, 2026 07:55
@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch from 1f1d4d4 to dc613f3 Compare October 7, 2026 09:05
@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch from dc613f3 to c556a9a Compare October 7, 2026 11:01
@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch 2 times, most recently from 1a7c37f to 85a09f4 Compare October 7, 2026 17:03
The PiHarness of the agents SDK keeps the state of pi-durable in the
SQLite database of the Durable Object, in tables with a pi_ prefix. Each
statement became a db.query span, close to 200 for one run, and they
buried the agent spans of the run. The tables are now treated like the
cf_ tables of the agents framework: their statements start no span, and
durableObjectSqlSpanAllowlist brings them back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JPeer264
JPeer264 force-pushed the jp/cloudflare-skip-pi-tables branch from 85a09f4 to 5ac7830 Compare October 8, 2026 11:27
@JPeer264
JPeer264 merged commit 966e1ff into develop Oct 8, 2026
227 of 230 checks passed
@JPeer264
JPeer264 deleted the jp/cloudflare-skip-pi-tables branch October 8, 2026 12:49
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