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

feat(alerts): Create eap snuba subscription using rpc timeseries request #80665

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

edwardgou-sentry
Copy link
Contributor

@edwardgou-sentry edwardgou-sentry commented Nov 13, 2024

Updates Alert Rule creation for EAP alerts to use the Create Subscription RPC endpoint in snuba (getsentry/snuba#6499)

Constructs and passes a TimeSeriesRequest to be used in the subscription creation.

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

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

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/snuba/entity_subscription.py 88.88% 2 Missing and 2 partials ⚠️
src/sentry/snuba/tasks.py 87.50% 2 Missing ⚠️
src/sentry/incidents/serializers/alert_rule.py 50.00% 0 Missing and 1 partial ⚠️
src/sentry/utils/snuba_rpc.py 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #80665      +/-   ##
==========================================
+ Coverage   78.35%   78.38%   +0.02%     
==========================================
  Files        7212     7218       +6     
  Lines      319167   319627     +460     
  Branches    43946    43999      +53     
==========================================
+ Hits       250082   250538     +456     
+ Misses      62714    62711       -3     
- Partials     6371     6378       +7     

endpoint_name: str, class_version: str, req: SnubaRPCRequest
endpoint_name: str,
class_version: str,
req: SnubaRPCRequest | CreateSubscriptionRequest,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, the CreateSubscriptionRequest protobuf doesn't have a meta attribute with a referrer. I've added CreateSubscriptionRequest as a valid type here to handle these scenarios. I'm open to updating the protobuf to include meta instead if we feel that would be better

Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine for now, I'll clean this up in a future pass 👍

@edwardgou-sentry edwardgou-sentry requested a review from a team November 13, 2024 22:41
@edwardgou-sentry edwardgou-sentry marked this pull request as ready for review November 13, 2024 22:41
@edwardgou-sentry edwardgou-sentry requested a review from a team as a code owner November 13, 2024 22:41
Copy link
Member

@wmak wmak left a comment

Choose a reason for hiding this comment

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

lgtm, but i'm not that familiar with the alerts code

src/sentry/snuba/tasks.py Outdated Show resolved Hide resolved
endpoint_name: str, class_version: str, req: SnubaRPCRequest
endpoint_name: str,
class_version: str,
req: SnubaRPCRequest | CreateSubscriptionRequest,
Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine for now, I'll clean this up in a future pass 👍

@edwardgou-sentry edwardgou-sentry merged commit 00ea404 into master Nov 14, 2024
49 of 50 checks passed
@edwardgou-sentry edwardgou-sentry deleted the egou/feat/alerts-create-eap-rpc-subscription branch November 14, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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