Skip to content

Commit

Permalink
feat(spans): tag user.geo.subregion on mobile spans (#3927)
Browse files Browse the repository at this point in the history
Work toward getsentry/sentry#75230
This PR allows mobile spans to be filtered down by subregion too.

Anywhere we tag `device.class`, we also should also tag
`user.geo.subregion` for this to work
  • Loading branch information
DominikB2014 authored Aug 14, 2024
1 parent f2980a8 commit 50cf4f9
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Extract client sdk from transaction into profiles. ([#3915](https://github.com/getsentry/relay/pull/3915))
- Extract `user.geo.subregion` into span metrics/indexed. ([#3914](https://github.com/getsentry/relay/pull/3914))
- Add `last_peek` field to the `Priority` struct. ([#3922](https://github.com/getsentry/relay/pull/3922))
- Extract `user.geo.subregion` for mobile spans. ([#3927](https://github.com/getsentry/relay/pull/3927))

## 24.7.1

Expand Down
12 changes: 12 additions & 0 deletions relay-dynamic-config/src/defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ pub fn hardcoded_span_metrics() -> Vec<(GroupKey, Vec<MetricSpec>, Vec<TagMappin
Tag::with_key("span.group")
.from_field("span.sentry_tags.group")
.always(),
Tag::with_key("user.geo.subregion")
.from_field("span.sentry_tags.user.geo.subregion")
.always(),
Tag::with_key("device.class")
.from_field("span.sentry_tags.device.class")
.always(),
Expand Down Expand Up @@ -506,6 +509,9 @@ pub fn hardcoded_span_metrics() -> Vec<(GroupKey, Vec<MetricSpec>, Vec<TagMappin
Tag::with_key("span.group")
.from_field("span.sentry_tags.group")
.always(),
Tag::with_key("user.geo.subregion")
.from_field("span.sentry_tags.user.geo.subregion")
.always(),
Tag::with_key("device.class")
.from_field("span.sentry_tags.device.class")
.always(),
Expand Down Expand Up @@ -541,6 +547,9 @@ pub fn hardcoded_span_metrics() -> Vec<(GroupKey, Vec<MetricSpec>, Vec<TagMappin
Tag::with_key("span.group")
.from_field("span.sentry_tags.group")
.always(),
Tag::with_key("user.geo.subregion")
.from_field("span.sentry_tags.user.geo.subregion")
.always(),
Tag::with_key("device.class")
.from_field("span.sentry_tags.device.class")
.always(),
Expand Down Expand Up @@ -576,6 +585,9 @@ pub fn hardcoded_span_metrics() -> Vec<(GroupKey, Vec<MetricSpec>, Vec<TagMappin
Tag::with_key("span.group")
.from_field("span.sentry_tags.group")
.always(),
Tag::with_key("user.geo.subregion")
.from_field("span.sentry_tags.user.geo.subregion")
.always(),
Tag::with_key("device.class")
.from_field("span.sentry_tags.device.class")
.always(),
Expand Down
9 changes: 9 additions & 0 deletions relay-server/src/metrics_extraction/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,15 @@ mod tests {
const MOBILE_EVENT: &str = r#"
{
"type": "transaction",
"user": {
"id": "user123",
"geo": {
"country_code": "US",
"city": "Washington",
"subdivision": "Virginia",
"region": "United States"
}
},
"sdk": {"name": "sentry.javascript.react-native"},
"start_timestamp": "2021-04-26T07:59:01+0100",
"timestamp": "2021-04-26T08:00:00+0100",
Expand Down
Loading

0 comments on commit 50cf4f9

Please sign in to comment.