Skip to content

Conversation

@kcons
Copy link
Member

@kcons kcons commented Nov 15, 2025

We want DetectorGroups for all error Groups.
This is a somewhat tricky thing to backfill, but we can do it incrementally as new events come in for the cost of a single query in the common case. This should result in full coverage in the lifespan of a Group (30 days?) and ensures that any recurring older group will have coverage, which is nice.

A real backfill would certainly be faster, but this is easy, safe. and largely makes a real backfill unnecessary.

@kcons kcons requested review from a team as code owners November 15, 2025 01:29
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 15, 2025
@kcons kcons changed the title feat(aci): Ensure DetectorGroup for new error group events feat(aci): Ensure DetectorGroup for new events on existing error Groups Nov 15, 2025
@codecov
Copy link

codecov bot commented Nov 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #103419      +/-   ##
===========================================
- Coverage   80.67%    80.67%   -0.01%     
===========================================
  Files        9243      9243              
  Lines      394826    394936     +110     
  Branches    25152     25152              
===========================================
+ Hits       318538    318615      +77     
- Misses      75841     75874      +33     
  Partials      447       447              

@mifu67 mifu67 self-requested a review November 17, 2025 19:09
Copy link
Contributor

@mifu67 mifu67 left a comment

Choose a reason for hiding this comment

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

You're only touching error issues here—ensure_association_with_detector is never called with a detector ID. Did you want to handle other grouptypes in a separate PR?
In any case, I think that save_issue_occurrence is a good place to handle healing the relationship for metric issues. We can get the detector ID using occurrence_data.evidence_data. Let me know too if you want me to handle that.

flags=FLAG_AUTOMATOR_MODIFIABLE,
)

register(
Copy link
Contributor

Choose a reason for hiding this comment

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

Just confirming that you know what this is doing (I have never seen flags like this before but I trust you 😅)

Copy link
Member Author

Choose a reason for hiding this comment

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

Unless I'm missing something, I've used option values like this for infrastructural kill switches a few times in the past. We usually use flags that let us roll things out, but if the real goal is just be able to turn something off very quickly and it's not necessarily and org or project specific thing, this seems the easiest way.

@kcons
Copy link
Member Author

kcons commented Nov 17, 2025

You're only touching error issues here—ensure_association_with_detector is never called with a detector ID. Did you want to handle other grouptypes in a separate PR? In any case, I think that save_issue_occurrence is a good place to handle healing the relationship for metric issues. We can get the detector ID using occurrence_data.evidence_data. Let me know too if you want me to handle that.

I was initially just targeting errors here, since for metric issues there was already a migration PR out, but I intentionally left the helper method more general to allow us to extend it to other issue types. So, happy to do that here.

@kcons kcons marked this pull request as draft November 17, 2025 22:02
@kcons kcons marked this pull request as ready for review November 17, 2025 23:54
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.

3 participants