Skip to content

Commit ecb37d0

Browse files
authored
Added device_type to tag mapping (#104957)
1 parent 93f3fd9 commit ecb37d0

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/sentry/interfaces/contexts.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ class AppContextType(ContextType):
183183
@contexttype
184184
class DeviceContextType(ContextType):
185185
type = "device"
186-
context_to_tag_mapping = {"": "{model}", "family": "{family}"}
186+
context_to_tag_mapping = {
187+
"": "{model}",
188+
"family": "{family}",
189+
"device_type": "{device_type}",
190+
}
187191
# model_id, arch
188192

189193

tests/sentry/event_manager/interfaces/snapshots/test_contexts/test_device.pysnap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ errors: null
77
tags:
88
- - device
99
- iPad
10+
- - device.device_type
11+
- Handheld
1012
to_json:
1113
device:
1214
arch: arm64
15+
device_type: Handheld
1316
model: iPad
1417
model_id: 1234AB
1518
name: My iPad

tests/sentry/event_manager/interfaces/test_contexts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_device(make_ctx_snapshot) -> None:
7373
"model_id": "1234AB",
7474
"version": "1.2.3",
7575
"arch": "arm64",
76+
"device_type": "Handheld",
7677
}
7778
}
7879
)

0 commit comments

Comments
 (0)