Repository navigation
feat(workflow_engine): Add in hook for producing occurrences from the stateful detector - #1815
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.
StatefulDetectorHandler requires implementations of counter_names, get_dedupe_value, get_group_key_values, and build_occurrence_and_event_data. This empty subclass is therefore abstract. Accessing detector.detector_handler for a metric_alert_fire detector now raises TypeError when the property instantiates the registered handler, aborting process_detectors before it can process the remaining detectors. Implement these methods before switching the base class, or retain a concrete DetectorHandler stub whose evaluate returns {}.
See title.