Repository navigation
feat(aci): Update backend to support fetching open periods across groups - #126786
Conversation
|
bugbot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit daad69c. Configure here.
yuvmen
left a comment
There was a problem hiding this comment.
lgtm overall, just a question there
| return False | ||
|
|
||
| return ( | ||
| issubclass(detector_settings.handler, StatefulDetectorHandler) |
There was a problem hiding this comment.
Probably out of scope of this PR but this looks like a weird check I must say. Kinda surprised activation_creates_new_issue is on the StatefulDetectorHandler, like it would make sense if it let you abstract it away, but you still end up asserting the subclass when you check it so perhaps it can just be on MetricIssueDetectorHandler? just a thought, perhaps there are more reasons why it cant be there, and anyway probably shouldnt change in this PR
There was a problem hiding this comment.
If you mean why the activation_creates_new_issue is on the stateful detector handler and not on the metric issue handler, it was an intentional choice to put it on the more general state detector handler base class. The thought was that in the future it is feasible we would want other stateful detector handlers like uptime to have this same functionality and then all you have to do it set that single class var
Resolves ID-1913
The
sentryorganization is feature-flagged so that instead of opening and closing the same issue over and over, metric monitors now open a new issue for every open periodThat breaks the assumption for the open periods endpoint because previously it did the following
We need to update the backend so that given a detector id, it returns the open periods associated with that detector across multiple groups
This will then allow us to update the frontend to show multiple firings on the metric monitor's graph and have a table showing the X most recent open periods
After this PR the frontend should not change a whole lot: There are 3 cases
non-metric detectors: no change. Those detectors query by group id or not at all. And we have a code branch so that they get the old behavior anyways
metric detectors for organizations not feature flagged in: expected no change. There is a test showing covering this case.
metric detectors for organizations feature: The chart should highlight every open period now and not just the most recent one
After this PR I can update the frontend so the "Ongoing Issues" table can be replaced with a "Recent Issues" table.