Skip to content
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

snuba(devexp): Migrate meta queries to use storage direct queries #70794

Merged
merged 3 commits into from
May 14, 2024

Conversation

enochtangg
Copy link
Member

Overview

Now that snuba supports querying a storage directly (as opposed to querying an entity), meta queries are a great candidate to take advantage of this. All meta queries are executed through the metrics layer, therefore these changes will apply to any product (right now just DDM) running meta queries. The main change is switching out Entity for Storage in the match clause of the query.

Testing

This change is guarded behind the sentry option: sentry-metrics.metrics-layer.use-storage-direct-meta-queries and will be slowly rolled out + monitored.

@enochtangg enochtangg requested a review from a team as a code owner May 13, 2024 18:53
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 13, 2024
Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 80.00%. Comparing base (03b9119) to head (af6ee1e).
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #70794       +/-   ##
===========================================
- Coverage   88.30%   80.00%    -8.30%     
===========================================
  Files        2861     6507     +3646     
  Lines      178774   290843   +112069     
  Branches    31900    50129    +18229     
===========================================
+ Hits       157862   232698    +74836     
- Misses      20910    57713    +36803     
- Partials        2      432      +430     
Files Coverage Δ
src/sentry/options/defaults.py 100.00% <100.00%> (ø)
src/sentry/snuba/metrics_layer/query.py 93.86% <75.00%> (-0.53%) ⬇️

... and 4094 files with indirect coverage changes

OrderBy(Column("project_id"), Direction.ASC),
OrderBy(Column(column_name), Direction.ASC),
]
if in_random_rollout("sentry-metrics.metrics-layer.use-storage-direct-meta-queries"):
Copy link
Member

Choose a reason for hiding this comment

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

where you able to run the CI tests using the storage-direct-meta-queries on?

Copy link
Member Author

Choose a reason for hiding this comment

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

Tested on CI with flag enabled 👍

Copy link
Member

@volokluev volokluev left a comment

Choose a reason for hiding this comment

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

Looks good. If we can run CI with this flag on that would be even better

@enochtangg enochtangg merged commit 671b4f9 into master May 14, 2024
48 of 49 checks passed
@enochtangg enochtangg deleted the enocht/meta-storage-direct-querie branch May 14, 2024 17:13
@github-actions github-actions bot locked and limited conversation to collaborators May 30, 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.

None yet

2 participants