getsentry / sentry

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

ref(rules): Refactor `get_rate` to be used for bulk queries #69446

Closed ceorourke closed 3 weeks ago

ceorourke commented 3 weeks ago

The apply_delayed rule processor needs to call get_rate with bulk Snuba queries (see this code block), so this PR refactors get_rate to handle that.

ceorourke commented 3 weeks ago

@saponifi3d idk why I can't reply to your comment about the branch, I'd prefer to find out now rather than later when we have a lot more going on if I somehow fucked this up

codecov[bot] commented 3 weeks ago

Codecov Report

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

Project coverage is 79.64%. Comparing base (6c0b883) to head (b3304fb). Report is 1 commits behind head on master.

:exclamation: Current head b3304fb differs from pull request most recent head 56120ee. Consider uploading reports for the commit 56120ee to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #69446 +/- ## =========================================== - Coverage 86.21% 79.64% -6.58% =========================================== Files 2848 6469 +3621 Lines 176602 287223 +110621 Branches 31517 49495 +17978 =========================================== + Hits 152261 228761 +76500 - Misses 24338 58040 +33702 - Partials 3 422 +419 ``` | [Files](https://app.codecov.io/gh/getsentry/sentry/pull/69446?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry) | Coverage Δ | | |---|---|---| | [src/sentry/rules/conditions/event\_frequency.py](https://app.codecov.io/gh/getsentry/sentry/pull/69446?src=pr&el=tree&filepath=src%2Fsentry%2Frules%2Fconditions%2Fevent_frequency.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry#diff-c3JjL3NlbnRyeS9ydWxlcy9jb25kaXRpb25zL2V2ZW50X2ZyZXF1ZW5jeS5weQ==) | `90.40% <72.41%> (+8.12%)` | :arrow_up: | ... and [4282 files with indirect coverage changes](https://app.codecov.io/gh/getsentry/sentry/pull/69446/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=getsentry)
ceorourke commented 3 weeks ago

So we've now added comparison type and interval to the data fixtures to determine our rates?

a few nit comments

no, nothing is added. I just moved stuff around

sentry-io[bot] commented 3 weeks ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎

sentry-io[bot] commented 3 weeks ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎