Issue
I want to understand the order in which Sentry evaluates ownership rules and CODEOWNERS, especially when multiple stack trace frames match different rules, and which match determines auto-assignment.
Applies To
All SaaS Customers and Self-Hosted Users
Issue Ownership
Error Issues
Resolution
Sentry determines ownership based on the order of matching rules, not the order of stack trace frames.
When processing an issue, Sentry checks whether any in-app stack frame matches an ownership rule. It then evaluates the matching rules in this order: CODEOWNERS from top to bottom, followed by ownership rules from top to bottom.
The last matching rule wins. This means that if both a CODEOWNERS rule and an ownership rule match, the ownership rule takes priority because it is evaluated later.
The position of a matching frame in the stack trace does not affect the result. For example, if one rule matches frame 0 and another matches frame 1, Sentry does not prioritize the rule that matched the higher or lower frame. It uses whichever rule appears last in the combined CODEOWNERS and ownership rules evaluation order.
If the winning rule specifies multiple owners, Sentry assigns the issue to the first (leftmost) owner listed in that rule.
For a step-by-step example of how this evaluation works, please see here.
