feat(core): Send sentry.is_localhost on every streamed span - #24597
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7007c3f. Configure here.
Contributor
size-limit report 📦
|
Tests that compare a whole span (or its full attribute bag) with `toEqual` need the new attribute spelled out. Spans of a request served over localhost get `true`; spans with no request in scope (db scripts, `sentry-test.io` browser pages) get `false`. Also bumps the `@sentry/cloudflare (withSentry)` size limit, which the extra matching logic pushes 892 bytes over, and drops `spanStreamingIntegration()` from the new browser test since streaming is the v11 default. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Covers the cases the first pass missed: the nestjs `@SentryTraced` helper (reached via `toEqual(tracedSpan(...))` rather than an object literal) and the redis/postgres suites, which need Docker and so only surfaced in CI.
Hardcoding `true` in the shared helpers was wrong for the app_creation span, which is emitted at startup before any request and so is `false`. Every span of a trace shares its segment's verdict, so deriving it covers both cases — the same way the helper already derives `sentry.release`.
CI builds measure ~528 bytes larger than a local build, so the previous 501 KiB bump (sized off the local number) still failed at 513.42 kB. Sized off CI's figure this time.
Lms24
marked this pull request as ready for review
September 22, 2026 19:06
Lms24
requested review from
isaacs,
logaretm and
mydea
and removed request for
a team
September 22, 2026 19:06
logaretm
approved these changes
Sep 22, 2026
`http://[::1]:3000` was reported as non-localhost. Note `location.hostname` keeps the brackets for IPv6 hosts, so the comparison is against `[::1]`, not `::1`. Server-side already covers this through the socket address.
47 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Following getsentry/sentry-conventions#646, this PR adds the new
is_localhostattribute which we'll use to indicate to Relay/Sentry backend, whether the "filter out events coming from localhost" inbound filter should filter out spans or not.See the conventions PR for reasoning why we ended up with this attribute rather than something more general.
See develop spec update for streamed spans: getsentry/sentry-docs#19559
Adding this is pretty, easy, as we can do it via
requestDataIntegrationfor server, andhttpContextIntegrationfor browser.