Skip to content

fix(discover): Fix has:measurements.* queries #78627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Oct 4, 2024

Fixes SENTRY-3DB9

We're seeing Snuba errors for comparisons of a numeric value to a string. e.g.,

`measurements.frames_frozen_rate` != ''

Measurements are numeric, so this errors out. This comparison is created for queries like has:measurements.frozen_frame_rate. That measurement is "synthetic", it's a function that divides two other measurements. It returns a numeric value, so comparison to string fails. The query builder's current logic doesn't account for measurement functions (i.e., plain measurements like measurements.lcp still work), and creates the comparison incorrectly.

The fix is to check for measurements, and return early with a basic check for null.

A measurement is nullable, but is not a column. The current logic falls
through, and creates a string comparison condition. Since measurements
are numeric, this fails in ClickHouse. Instead, queries for presence of
a measurement should use a simple `"isNull"` condition.
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 4, 2024
@gggritso gggritso marked this pull request as ready for review October 4, 2024 18:37
@gggritso gggritso requested review from a team as code owners October 4, 2024 18:37
@gggritso gggritso enabled auto-merge (squash) October 7, 2024 14:06
@gggritso gggritso merged commit da58a20 into master Oct 7, 2024
50 checks passed
@gggritso gggritso deleted the fix/discover/allow-has-measurement branch October 7, 2024 14:38
@github-actions github-actions bot locked and limited conversation to collaborators Oct 23, 2024
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