getsentry / getsentry/sentry

Add more device properties to `SHARED_SENTRY_ATTRIBUTES` for child span propagation

Open Beginner friendly
#123,933 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Product Area: Ingestion and Filtering Spans
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.

#215475846510042

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.