Repository navigation
feat(workflow_engine): Add in hook for producing occurrences from the stateful detector - #80168
Conversation
b3513f6 to
f196c85
Compare
461ad20 to
04aced8
Compare
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #80168 +/- ##
==========================================
- Coverage 78.09% 78.09% -0.01%
==========================================
Files 7185 7185
Lines 317446 317448 +2
Branches 43748 43747 -1
==========================================
- Hits 247904 247898 -6
- Misses 63203 63204 +1
- Partials 6339 6346 +7 |
| ) -> list[DetectorEvaluationResult]: | ||
| # TODO: Implement | ||
| return [] | ||
| class MetricAlertDetectorHandler(StatefulDetectorHandler[QuerySubscriptionUpdate]): |
There was a problem hiding this comment.
dang, this reads really well. 💯
| super().tearDown() | ||
| self.sm_comp_patcher.__exit__(None, None, None) | ||
|
|
||
| def create_detector_and_conditions(self, type: str | None = None): |
There was a problem hiding this comment.
nit: shuold type be an enum value instead of a string?
There was a problem hiding this comment.
It's a little tricky, and I thought maybe the flexibility is better since type on the model is a string. But we could rework it if it makes sense
| return build_mock_occurrence_and_event(self, group_key, value, new_status) | ||
|
|
||
|
|
||
| class BaseDetectorHandlerTest(BaseGroupTypeTest): |
There was a problem hiding this comment.
🤔 should we have a separate base test class for workflow engine that has methods to create conditions / detectors / workflows / data sources?
There was a problem hiding this comment.
I think that might make sense, but let's move this logic out as we need it and have shared test data needs
f196c85 to
230aa8e
Compare
04aced8 to
8d6f5c3
Compare
230aa8e to
9d0bb76
Compare
8d6f5c3 to
9ec1cf7
Compare
9ec1cf7 to
a87d92a
Compare
551778e to
0f99ed3
Compare
a87d92a to
a4ae39c
Compare
0f99ed3 to
64effae
Compare
a4ae39c to
05c3858
Compare
64effae to
b87fe97
Compare
05c3858 to
70af48f
Compare
… stateful detector This adds a hook that can be implemented to produce an occurrence specific to the detector that is subclassing the StatefulDetector. Also change the signature of evaluate to return a dict keyed by groupkey instead of a list. This helps avoid the chance of duplicate results for the same group key.
70af48f to
0fc39ce
Compare
* master: (67 commits) feat(dynamic-sampling): Sampling breakdown (#80304) feat(profiling): add organizations:continuous-profiling to the list of exposable features (#80236) chore(broadcasts): remove cta column from broadcast model (#80201) feat(dynamic-sampling): Use sample rates endpoint (#80235) feat(issues): Rearrange all events columns, sizes (#80296) fix(issues): All event table pagination counts (#80297) fix(issues): Preserve query parameters on all events close (#80295) feat(issues): Hide "comment" button until focused (#80283) fix(sentry-app): Adds better validation for invalid token request bodies (#80289) feat(workflow_engine): Add in hook for producing occurrences from the stateful detector (#80168) feat(issue summary) New structured issue summary design (#80273) feat(workflow_engine): Return status change messages when a stateful detector resolves (#80122) feat(insights): Add insights query date range footer hook (#80276) ref(crons): Switch to cronsim in sample data generator (#80278) feat(issue-details): Hide merged/similar issues for non-error issues (#80284) feat(issue summary) Update issue summary model (#80270) feat(crons): Add cronsim behind an option (#80271) fix(anomaly detection): add alerts analytics reqs to utils/analytics.tsx (#80281) feat(trace-explorer): Sort traces by timestamp in EAP (#80274) feat(workflow_engine): Implement basic evaluation in `DataCondition` (#80118) ...
This adds a hook that can be implemented to produce an occurrence specific to the detector that is subclassing the StatefulDetector.
Also change the signature of evaluate to return a dict keyed by groupkey instead of a list. This helps avoid the chance of duplicate results for the same group key.