Repository navigation
feat(workflow_engine): Add in hook for producing occurrences from the stateful detector - #1814
Conversation
… stateful detector (#80168) 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. <!-- Describe your PR here. -->
… stateful detector
There was a problem hiding this comment.
1 issue found.
About Unblocked
Unblocked has been set up to automatically review your team's pull requests to identify genuine bugs and issues.
📖 Documentation — Learn more in our docs.
💬 Ask questions — Mention @unblocked-local-kaihao to request a review or summary, or ask follow-up questions.
👍 Give feedback — React to comments with 👍 or 👎 to help us improve.
⚙️ Customize — Adjust settings in your preferences.
| class MetricAlertDetectorHandler(StatefulDetectorHandler[QuerySubscriptionUpdate]): | ||
| pass |
There was a problem hiding this comment.
This subclass leaves counter_names, get_dedupe_value, get_group_key_values, and build_occurrence_and_event_data abstract. Since MetricAlertFire still registers it as its handler, accessing detector.detector_handler for a metric_alert_fire detector now raises TypeError instead of returning the previous no-op handler. process_detectors does not catch this exception, so it aborts processing the packet and any remaining detectors. Implement the abstract members, or retain a concrete DetectorHandler with evaluate returning {} until the stateful implementation is ready.
See title.