Add more device properties to `SHARED_SENTRY_ATTRIBUTES` for child span propagation
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 23m
- Merged PRs (30d)
- 607
Description
Problem Statement
Mobile filtering/grouping spans by device.model get (no value) on child spans because device attributes are only stored on segment/root spans (via extract_segment_tags in Relay, PR #4651).
During segment processing, SHARED_SENTRY_ATTRIBUTES in enrichment.py copies certain root span attributes to child spans — sentry.device.class is already in this list, but sentry.device.model, sentry.device.brand, and sentry.device.name are not.
This might be a gap for mobile: when a former root span becomes a child span device data drops out of queries. Customers expect device.model on every span in a trace, not just the root.
Solution Brainstorm
Possible to include either—followingmodel, brand or name to SHARED_SENTRY_ATTRIBUTES in enrichment.py#L18-L27:
| Attribute | Currently propagated? |
|---|---|
sentry.device.class |
Yes |
sentry.device.model |
No |
sentry.device.brand |
No |
sentry.device.name |
No |
Product Area
Ingestion and Filtering
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/sentry/spans/consumers/process_segments/enrichment.py, especially the SHARED_SENTRY_ATTRIBUTES definition around lines 18–27, and compare it with the existing sentry.device.class entry. Confirm which of sentry.device.model, sentry.device.brand, and sentry.device.name should propagate to child spans, then verify that the selected attributes are present on child spans as well as root spans.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100