getsentry / getsentry/sentry

Update Apple device mappings

Open
#68,258 11 comments 0 reactions 1 assignee Assigned to @philippsuess View on GitHub
Task
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
22h 21m
Merged PRs (30d)
586

Description

We use (at least two) different sources to map Apple device models (e.g. `iPhone15,3`) to device model names (e.g. `iPhone 14 Pro Max`) and to resolve device classes (low/med/high) per model:
- [core](https://github.com/getsentry/sentry/blob/master/static/app/constants/ios-device-list.tsx) `ios-device-list.tsx`
- this is used to map device models (e.g. `iPhone15,3`) to device model names (e.g. `iPhone 14 Pro Max`) for the frontend
- until ~2022 this was automatically updated by a [script](https://github.com/getsentry/sentry/blob/e1457f25ce062f8144e2920eac834f54fc48e960/scripts/extract-ios-device-names.ts) which in turn uses a [node module](https://www.npmjs.com/package/ios-device-list) as data source
- this node module is not maintained anymore, so we need to
- perform updates manually or find another data source (though I didn't find a suitable one in a quick search) or
- fork/contribute to the node module
- ~~[profiling](https://github.com/getsentry/sentry/blob/master/src/sentry/profiles/device.py)~~ `device.py` - deprecated and replaced, see below
- ~~this is updated manually~~
- ~~this includes both device name mapping and heuristics do determine device class based on hardware specs~~
- [profiling](https://github.com/getsentry/sentry/blob/master/src/sentry/api/helpers/ios_models.py) `ios_models.py`
- file renamed from the above when device classification was removed in https://github.com/getsentry/sentry/pull/82139)
- this is updated manually
- this includes only the device name mapping for profiling
- for device classes, profiling now uses relay (see below)
- [relay](https://github.com/getsentry/relay/blob/master/relay-event-schema/src/protocol/device_class.rs) `device_class.rs`
- this is now used to map device models (e.g. `iPhone15,3`) to device classes directly, so doesn't rely on device name mapping

Docs:
- [this page](https://docs.sentry.io/concepts/search/searchable-properties/#device-classification) details how Mobile devices are mapped to device classes, so it needs to be updated along with any device class mapping changes

Related:
- https://github.com/getsentry/sentry/issues/47453
- https://github.com/getsentry/sentry/pull/68762
- https://github.com/getsentry/sentry/pull/82139
- https://github.com/getsentry/sentry/pull/87829
- https://github.com/getsentry/relay/pull/4609

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.