Closed sentry-io[bot] closed 2 weeks ago
This happens due to the race condition. Span connected to metric ingested, while for metric takes up to 3 minutes to be ingested. When users goes to metrics section - they can see spans connected to the metric and click on span to inspect more details. Problem happens when some new, never seen before tags, have been attached to the metric. Every tag key is, through indexer table, converted to number, but this happens only after the metric has been ingested. So the API will return that the tag exists (it is saved while processing span), but when the query tries to resolve that key using the indexer, it will raise an error since the key doesn't exists yet in the table.
This happens very rare because only in following scenario this can happen:
UI doesn't break when an error happens. I suggest we wait for SnS team to add more descriptive messages, and then we can handle this better on the product side
Also handle the case when there is a dashboard/widget that uses group by a tag that is later removed/ stop being sent.
E.g. in the begging there is a tag foo:bar
, and after the dashboard is created, and after some time passed, that tag is no longer sent. This will break that widget because query will fail with 500 error (it can't group by a tag that doesn't exist)
Prerequisite for this issue: https://github.com/getsentry/snuba/issues/6084
Sentry Issue: SENTRY-38JR
improve frontend validation or check the tags before querying on backend