Skip to content

feat(aci): Update backend to support fetching open periods across groups - #126786

Merged
RudraPatel2003 merged 1 commit into
masterfrom
rudra-metric-monitor-frontend
Oct 8, 2026
Merged

RudraPatel2003 merged 1 commit into
masterfrom
rudra-metric-monitor-frontend

Conversation

@RudraPatel2003

@RudraPatel2003 RudraPatel2003 commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Resolves ID-1913

The sentry organization 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 period

That breaks the assumption for the open periods endpoint because previously it did the following

  • Give it a group id --> find group --> find open periods (makes sense)
  • Give it a detector id --> find the most recent group the detector made --> find open periods
    • This will not work anymore since a metric monitor has multiple groups associated with it. We are only fetching the most recent group and its singular open period, leaving out all other groups and their open periods.

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.

@RudraPatel2003
RudraPatel2003 requested review from a team as code owners October 7, 2026 20:38
@linear-code

linear-code Bot commented Oct 7, 2026

Copy link
Copy Markdown

ID-1913

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Oct 7, 2026
@RudraPatel2003

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 yuvmen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm overall, just a question there

return False

return (
issubclass(detector_settings.handler, StatefulDetectorHandler)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@RudraPatel2003 RudraPatel2003 Oct 7, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@RudraPatel2003
RudraPatel2003 merged commit 90abd35 into master Oct 8, 2026
95 checks passed
@RudraPatel2003
RudraPatel2003 deleted the rudra-metric-monitor-frontend branch October 8, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants