-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(workflow_engine): Add can_process_data_packet
method to StatefulDetector
#89953
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
base: master
Are you sure you want to change the base?
Conversation
…fulDetector` We have various preconditions that are enforced by the uptime results consumer, like https://github.com/getsentry/sentry/blob/d86b8323384ecbdfae7167c9374e31da6eb7fdda/src/sentry/uptime/consumers/results_consumer.py#L207-L211 We need a way to include these as part of the abstraction. Adding this now and will implement for `UptimeDetector`. We might also need `can_process_data_packet_group` for more specific checks. We could also put the de-dupe checks there in the base class.
@saponifi3d I know you've been talking about making things more composition based - I think it'd be easy enough to switch this over in that direction when we get closer to it. |
could we just wait on invoking the |
I hadn't thought about that - I guess I assumed we want to move most logic into the detector. If that's not the case, I can just focus on moving this function in, which is basically where all the threshold detection happens in terms of firing an incident: sentry/src/sentry/uptime/consumers/results_consumer.py Lines 413 to 513 in d86b832
Our consumer has a separate branch of code that does detector like things: sentry/src/sentry/uptime/consumers/results_consumer.py Lines 349 to 411 in d86b832
The point of this is that it will basically validate thresholds in the same way a detector would, but we never create an occurrence. Instead, it monitors a url for a while before we move it into active mode or delete it. We would need access to the thresholds from the Detector here, but we could apply that logic outside of the detector.
|
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #89953 +/- ##
=======================================
Coverage 87.64% 87.64%
=======================================
Files 10250 10250
Lines 577029 577034 +5
Branches 22719 22719
=======================================
+ Hits 505725 505740 +15
+ Misses 70861 70851 -10
Partials 443 443 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change makes sense to me, is there a reason this sat like was the idea abandoned?
We have various preconditions that are enforced by the uptime results consumer, like
sentry/src/sentry/uptime/consumers/results_consumer.py
Lines 207 to 211 in d86b832
We need a way to include these as part of the abstraction. Adding this now and will implement for
UptimeDetector
.We might also need
can_process_data_packet_group
for any checks that might be group specific. We could also put the de-dupe checks there in the base class.