getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.05k stars 4.19k forks source link

Issue Details tag errors don't align with tag indices #68351

Open leeandher opened 6 months ago

leeandher commented 6 months ago

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. Create an issue with some broken tags (e.g. too long, \n character)
  2. Go to its issue details page
  3. No tooltip appears on broken tags

Expected Result

The tool tip should be attached to the relevant tag with an error.

(got this screenshot by editing the _meta value) image

Actual Result

The tags appear red from having null values, but there is no tooltip attached to them.

image

The interesting part is that atleast in my example, the indices provided from the Event API are incorrectly mapped to the event tags:

Here is the Raw API Call

Here are the relevant parts: image image

It is assigning the too long error to tag at index 12 instead of 11, and assigning the invalid character to the tag at index 17 instead of 15.

Not sure where this index is being incorrectly set, but it prevents us from knowing where to render the tooltips on issue details.

Link

https://sentry-leander.sentry.io/issues/5145681630/

getsantry[bot] commented 6 months ago

Routing to @getsentry/product-owners-issues for triage ⏲️

leeandher commented 5 months ago

Some poking around shows that this is caused by manually setting tags that we wish to override with structured context here: https://github.com/getsentry/sentry/blob/master/src/sentry/snuba/metrics/extraction.py#L196-L217

I set device.family manually, and when the value is extracted from context, it overrides my custom tag AND causes the indices to misalign for meta