Skip to content

feat(cloudflare)!: Skip rate limit spans - #23907

Merged
JPeer264 merged 3 commits into
developfrom
jp/remove-rate-limiter
Sep 2, 2026
Merged

feat(cloudflare)!: Skip rate limit spans#23907
JPeer264 merged 3 commits into
developfrom
jp/remove-rate-limiter

Conversation

@JPeer264

@JPeer264 JPeer264 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Removing rate limit spans. These spans didn't really give a great value rather than having more volume.

For the start of v11 we should remove them entirely and bring them back once we know how we can give proper value for that. I'll open a new ticket for it so we remember to re-add this functionality.

I don't suggest to re-add this at a later point as is, but maybe better. To only add spans when the rate limit actually hit, but this needs a little bit more thoughts and I think it's better to remove them at the start of v11 and re-add them later as feature with proper value.

The reason for this last minute change is that the update to v11 in the Sentry MCP added tons of low value spans, which we don't really need.

Also rpc is the wrong OP, so this needs also fixing

Example trace (these two spans didn't make sense, also rpc is wrong):

Screenshot 2026-09-02 at 10 57 17

After an update the spans were doubled with only these spans:

Screenshot 2026-09-02 at 10 57 03

@JPeer264 JPeer264 self-assigned this Sep 2, 2026
@JPeer264
JPeer264 requested a review from a team as a code owner September 2, 2026 08:54
@JPeer264
JPeer264 requested review from andreiborza, isaacs, mydea and s1gr1d and removed request for a team, isaacs and mydea September 2, 2026 08:54

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd rather fully remove the code instead of carrying it around commented. But maybe this could be an opt-in instead of hard-deciding to remove it for users?

Idk if anyone ever got values out of these so feel free to disregard the opt-in.

import { instrumentQueueProducer } from './instrumentQueueProducer';
import { instrumentR2Bucket } from './instrumentR2';
import { instrumentRateLimit } from './instrumentRateLimit';
// import { instrumentRateLimit } from './instrumentRateLimit';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: why comment them out? Should just be removed imo.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts Outdated
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.94 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.83 kB - -
@sentry/browser (incl. Tracing) 48.87 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.88 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.8 kB - -
@sentry/browser (incl. Tracing, Replay) 88.36 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.76 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.05 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.02 kB - -
@sentry/browser (incl. Feedback) 46.06 kB - -
@sentry/browser (incl. sendFeedback) 33.64 kB - -
@sentry/browser (incl. FeedbackAsync) 38.74 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.81 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.32 kB - -
@sentry/react (incl. Tracing) 51.08 kB - -
@sentry/vue 35.74 kB - -
@sentry/vue (incl. Tracing) 51.14 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.36 kB - -
CDN Bundle (incl. Tracing) 49.52 kB - -
CDN Bundle (incl. Logs, Metrics) 32.59 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.43 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.19 kB - -
CDN Bundle (incl. Tracing, Replay) 87.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.88 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.94 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.84 kB - -
CDN Bundle - uncompressed 89.97 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.58 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.27 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.27 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.43 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.07 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.75 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 280.77 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.44 kB - -
@sentry/nextjs (client) 53.7 kB - -
@sentry/sveltekit (client) 49.3 kB - -
@sentry/core/server 40.74 kB - -
@sentry/core/browser 13.42 kB - -
@sentry/node 124.04 kB +0.02% +21 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.51 kB - -
@sentry/node - without tracing 88.3 kB +0.03% +21 B 🔺
@sentry/node - without channel injection 103.35 kB +0.03% +21 B 🔺
@sentry/aws-serverless 96.66 kB +0.03% +25 B 🔺
@sentry/cloudflare (withSentry) - minified 200.71 kB -0.26% -517 B 🔽
@sentry/cloudflare (withSentry) 499.61 kB -0.27% -1.33 kB 🔽

View base workflow run

@JPeer264

JPeer264 commented Sep 2, 2026

Copy link
Copy Markdown
Member Author

Idk if anyone ever got values out of these so feel free to disregard the opt-in.

Don't think so. I'd rather remove than making another option to opt into that

@JPeer264
JPeer264 requested a review from andreiborza September 2, 2026 09:28
@JPeer264
JPeer264 merged commit 01232d8 into develop Sep 2, 2026
215 checks passed
@JPeer264
JPeer264 deleted the jp/remove-rate-limiter branch September 2, 2026 11:17
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