Repository navigation
feat(attributes): Add internal sentry.is_localhost attribute - #646
Merged
Merged
Conversation
Lms24
requested review from
a team,
cleptric,
mjq and
nsdeschenes
as code owners
September 22, 2026 14:19
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Internal Changes 🔧Deps
🤖 This preview updates automatically when you update the PR. |
cleptric
approved these changes
Sep 22, 2026
This was referenced Sep 22, 2026
Merged
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e0abbde. Configure here.
Lms24
added a commit
to getsentry/sentry-javascript
that referenced
this pull request
Sep 23, 2026
Following getsentry/sentry-conventions#646, this PR adds the new `is_localhost` attribute 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 `requestDataIntegration` for server, and `httpContextIntegration` for browser.
4 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.

This PR adds a new attribute marked as internal called
sentry.is_localhost. The purpose of this is that SDKs must attach it to every telemetry item (all spans, logs, metrics) so that our "Filter out events from localhost" inbound filter can be applied to all attribute-exclusive telemetry.We explored several more generic options, enumerated in #636, but the issue here basically boiled down to:
server.addressis set onhttp.severspans for the server host address (correct), but also for outgoing spans (http.client,db, etc) describing the target server address. So we can't apply it to every span.url.*attributeshost.*attributes which we could introduce newly, but there's no attribute in OTel that covers the domain. Only the ip address. So we'd again need to introduce a new attribute on top (something likehost.address). Which is prone to be misused again. Hence the choice to go specific.browser.document.url.full, which could carry the current location host name, so theoretically we could use this as well. Though in this case,sentry.is_localhostworks in both cases.