getsentry / sentry

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

Handle the failing of a query for a non-existent tag group by on /metrics/query #74261

Closed matejminar closed 1 month ago

matejminar commented 3 months ago

Ignore non existent tags, if the tag is non existent, return everything as one group (only one timeseries).

vgrozdanic commented 3 months ago

Update: still waiting for the response from the SnS team on this, but it seems that they are currently having bigger issues...

We will wait for a couple more days, then I will ping them again about this.

enochtangg commented 2 months ago

From an discussion offline, rather than returning the result without the missing groupby tag, we have decided to improve snuba error messaging instead. Currently, with the new span based metrics, queries with missing groupby tags are hitting snuba, reach ClickHouse and returns an HTTP 500 with a poor error message. This is because the tag does not exist yet. We should improve snuba error response and messaging with something like "query failed: not possible to group by tag foo" rather than returning the entire ClickHouse stacktrace. By doing this, we could have the flexibility to handle missing tags differently in the metrics layer by retrying the query.

S&S is tracking this task here: https://github.com/getsentry/team-sns/issues/27

onkar commented 1 month ago

@vgrozdanic I resolved https://github.com/getsentry/snuba/issues/6084 through PR https://github.com/getsentry/snuba/pull/6244 which was similar i.e. column name not being resolved properly. Can you please verify if https://github.com/getsentry/snuba/pull/6244 solves this issue as well? If it does not, then please share the error response you get on group by and I will be happy to take another look.

onkar commented 1 month ago

I believe this issue is already resolved based on the previous comment. Closing this issue for now. Feel free to reopen and provide error details if you see it again.