Skip to content

feat(trace-item-details): Add sentry.links - #95605

Merged
wmak merged 6 commits into
masterfrom
wmak/feat/add-links-to-trace-item-details
Jul 16, 2025
Merged

wmak merged 6 commits into
masterfrom
wmak/feat/add-links-to-trace-item-details

Conversation

@wmak

@wmak wmak commented Jul 15, 2025

Copy link
Copy Markdown
Member
  • This adds sentry.links to the trace item response under the link key. For now we're not doing anything extra except parsing and deserializing the string
  • Also preventing it from being queried in events since this isn't a field we want to deal with migrating later

- This adds sentry.links to the trace item response under the link key.
  For now we're not doing anything extra except parsing and
  deserializing the string
- Also preventing it from being queried in events since this isn't a
  field we want to deal with migrating later
@wmak
wmak requested a review from a team as a code owner July 15, 2025 20:48
@wmak
wmak requested a review from a team July 15, 2025 20:48
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jul 15, 2025

@gggritso gggritso left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet!

cursor[bot]

This comment was marked as outdated.

@codecov

codecov Bot commented Jul 15, 2025 •

Copy link
Copy Markdown

❌ 3 Tests Failed:

Tests completed Failed Passed Skipped
27185 3 27182 235
View the top 3 failed test(s) by shortest run time
tests.snuba.api.endpoints.test_project_trace_item_details.ProjectTraceItemDetailsEndpointTest::test_user_attributes_collide_with_sentry_attributes
Stack Traces | 2.92s run time
#x1B[1m#x1B[.../api/endpoints/test_project_trace_item_details.py#x1B[0m:368: in test_user_attributes_collide_with_sentry_attributes
    assert trace_details_response.data == {
#x1B[1m#x1B[31mE   AssertionError: assert {'attributes'...eta': {}, ...} == {'attributes'...15T20:59:40Z'}#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Omitting 4 identical items, use -vv to show#x1B[0m
#x1B[1m#x1B[31mE     Left contains 1 more item:#x1B[0m
#x1B[1m#x1B[31mE     {'links': None}#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Full diff:#x1B[0m
#x1B[1m#x1B[31mE       {#x1B[0m
#x1B[1m#x1B[31mE           'attributes': [#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'project_id',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '4556422615924738',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'severity_number',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '0',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[sentry.timestamp_nanos,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '1752613180502000128',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[sentry.timestamp_precise,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '1752613180502000128',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'message',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 'foo',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'severity',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 'INFO',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[severity,string]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 'baz',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[timestamp,string]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 'bar',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'trace',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '3564761bee7f418385f2861d035b25c5',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE           ],#x1B[0m
#x1B[1m#x1B[31mE           'itemId': 'f67a64283755808dc04c35a6630f075f',#x1B[0m
#x1B[1m#x1B[31mE     +     'links': None,#x1B[0m
#x1B[1m#x1B[31mE           'meta': {},#x1B[0m
#x1B[1m#x1B[31mE           'timestamp': '2025-07-15T20:59:40Z',#x1B[0m
#x1B[1m#x1B[31mE       }#x1B[0m
tests.snuba.api.endpoints.test_project_trace_item_details.ProjectTraceItemDetailsEndpointTest::test_simple_using_logs_item_type
Stack Traces | 3.03s run time
#x1B[1m#x1B[.../api/endpoints/test_project_trace_item_details.py#x1B[0m:123: in test_simple_using_logs_item_type
    assert trace_details_response.data == {
#x1B[1m#x1B[31mE   AssertionError: assert {'attributes'...eta': {}, ...} == {'attributes'...15T20:59:49Z'}#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Omitting 4 identical items, use -vv to show#x1B[0m
#x1B[1m#x1B[31mE     Left contains 1 more item:#x1B[0m
#x1B[1m#x1B[31mE     {'links': None}#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Full diff:#x1B[0m
#x1B[1m#x1B[31mE       {#x1B[0m
#x1B[1m#x1B[31mE           'attributes': [#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'bool_attr',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'bool',#x1B[0m
#x1B[1m#x1B[31mE                   'value': True,#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[float_attr,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'float',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 3.0,#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'project_id',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '4556422616514562',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'severity_number',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '0',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[int_attr,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '2',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[sentry.timestamp_nanos,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '1752613189158999808',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[sentry.timestamp_precise,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '1752613189158999808',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'message',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 'foo',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'severity',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 'INFO',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'str_attr',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '1',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'trace',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '4078e3703305475d87ed5599e2ebca7b',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE           ],#x1B[0m
#x1B[1m#x1B[31mE           'itemId': 'bcdae752851778aefd42226bc7e31bf5',#x1B[0m
#x1B[1m#x1B[31mE     +     'links': None,#x1B[0m
#x1B[1m#x1B[31mE           'meta': {},#x1B[0m
#x1B[1m#x1B[31mE           'timestamp': '2025-07-15T20:59:49Z',#x1B[0m
#x1B[1m#x1B[31mE       }#x1B[0m
tests.snuba.api.endpoints.test_project_trace_item_details.ProjectTraceItemDetailsEndpointTest::test_logs_with_a_meta_key
Stack Traces | 3.52s run time
#x1B[1m#x1B[.../api/endpoints/test_project_trace_item_details.py#x1B[0m:317: in test_logs_with_a_meta_key
    assert trace_details_response.data == {
#x1B[1m#x1B[31mE   AssertionError: assert {'attributes'...float'}}, ...} == {'attributes'...15T21:00:15Z'}#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Omitting 4 identical items, use -vv to show#x1B[0m
#x1B[1m#x1B[31mE     Left contains 1 more item:#x1B[0m
#x1B[1m#x1B[31mE     {'links': None}#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Full diff:#x1B[0m
#x1B[1m#x1B[31mE       {#x1B[0m
#x1B[1m#x1B[31mE           'attributes': [#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'bool_attr',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'bool',#x1B[0m
#x1B[1m#x1B[31mE                   'value': True,#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[float_attr,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'float',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 3.0,#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'project_id',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '4556422618284033',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'severity_number',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '0',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[int_attr,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '2',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[sentry.timestamp_nanos,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '1752613215865999872',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'tags[sentry.timestamp_precise,number]',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'int',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '1752613215865999872',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'message',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '[Filtered]',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'severity',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 'INFO',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'str_attr',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': '1',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               {#x1B[0m
#x1B[1m#x1B[31mE                   'name': 'trace',#x1B[0m
#x1B[1m#x1B[31mE                   'type': 'str',#x1B[0m
#x1B[1m#x1B[31mE                   'value': 'fb3c6377aed24cbb93c83d9a79269c41',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE           ],#x1B[0m
#x1B[1m#x1B[31mE           'itemId': '6a241e8ee166839a304ef562d06ac548',#x1B[0m
#x1B[1m#x1B[31mE     +     'links': None,#x1B[0m
#x1B[1m#x1B[31mE           'meta': {#x1B[0m
#x1B[1m#x1B[31mE               'message': {#x1B[0m
#x1B[1m#x1B[31mE                   'length': 300,#x1B[0m
#x1B[1m#x1B[31mE                   'reason': 'value too long',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE               'tags[float_attr,number]': {#x1B[0m
#x1B[1m#x1B[31mE                   'unit': 'float',#x1B[0m
#x1B[1m#x1B[31mE               },#x1B[0m
#x1B[1m#x1B[31mE           },#x1B[0m
#x1B[1m#x1B[31mE           'timestamp': '2025-07-15T21:00:15Z',#x1B[0m
#x1B[1m#x1B[31mE       }#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@wmak
wmak merged commit 3e647cf into master Jul 16, 2025
@wmak
wmak deleted the wmak/feat/add-links-to-trace-item-details branch July 16, 2025 19:26
cursor Bot pushed a commit that referenced this pull request Jul 18, 2025
- This adds sentry.links to the trace item response under the link key.
For now we're not doing anything extra except parsing and deserializing
the string
- Also preventing it from being queried in events since this isn't a
field we want to deal with migrating later
andrewshie-sentry pushed a commit that referenced this pull request Jul 21, 2025
- This adds sentry.links to the trace item response under the link key.
For now we're not doing anything extra except parsing and deserializing
the string
- Also preventing it from being queried in events since this isn't a
field we want to deal with migrating later
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 1, 2025

This branch was successfully deployed

1 active deployment
Preview — 036ad90e Deployed Jul 16, 2025 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants