Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(spans): check sdk platform for user.geo.subregion tag #4023

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- Remove the OTEL spans endpoint in favor of Envelopes. ([#3973](https://github.com/getsentry/relay/pull/3973))
- Remove the `generate-schema` tool. Relay no longer exposes JSON schema for the event protocol. Consult the Rust type documentation of the `relay-event-schema` crate instead. ([#3974](https://github.com/getsentry/relay/pull/3974))
- Allow creation of `SqliteEnvelopeBuffer` from config, and load existing stacks from db on startup. ([#3967](https://github.com/getsentry/relay/pull/3967))
- Only tag `user.geo.subregion` on frontend and mobile projects. ([#4013](https://github.com/getsentry/relay/pull/4013))
- Only tag `user.geo.subregion` on frontend and mobile projects. ([#4013](https://github.com/getsentry/relay/pull/4013), [#4023](https://github.com/getsentry/relay/pull/4023))

## 24.8.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,9 @@ fn extract_shared_tags(event: &Event) -> BTreeMap<SpanTagKey, String> {
}

// We only want this on frontend or mobile modules.
let should_extract_geo =
event.context::<BrowserContext>().is_some() || MOBILE_SDKS.contains(&event.sdk_name());
let should_extract_geo = (event.context::<BrowserContext>().is_some()
&& event.platform.as_str() == Some("javascript"))
Copy link
Member

Choose a reason for hiding this comment

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

Couldn't this still be a javascript backend client? Or is python the only backend SDK that sets browser context?

Copy link
Contributor Author

@DominikB2014 DominikB2014 Sep 11, 2024

Choose a reason for hiding this comment

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

@jjbayer Yes but this is not a super common case, because most javascript backends have platform set to "node" instead of javascript. This is a pretty easy change to add, so I think we can see how much of an improvement it makes before moving onto more improvements.

|| MOBILE_SDKS.contains(&event.sdk_name());

if should_extract_geo {
if let Some(country_code) = user.geo.value().and_then(|geo| geo.country_code.value()) {
Expand Down Expand Up @@ -2745,6 +2746,9 @@ LIMIT 1
"trace": {
"trace_id": "ff62a8b040f340bda5d830223def1d81",
"span_id": "bd429c44b67a3eb4"
},
"browser": {
"name": "Chrome"
}
},
"user": {
Expand Down
Loading