Learn how to implement a rules based approach to automatically assign an error to a collaborator or team
Automatic Error Assignment is available for Enterprise plans only.
Triaging errors can be a repetitive process and often follows the same decision-making process, for example assigning all errors that originate from files in the src/components/cart
directory to the “Cart Team” or an individual collaborator. BugSnag allows you to create rules to automate this process.
To get started with automatic error assignment go to Project settings > Automatic error assignment.
You can configure a rule to match errors in the following ways:
Code rules use glob pattern matching to compare your rule against the stacktrace. You can reference the Linux documentation for more information on glob patterns.
Code rules can match errors using either:
This option can be used to assign an error based on the source file’s name or directory.
Method rules can be used to assign errors based on the frame’s fully qualified method name, including the class and package/namespace. This should be used where the source file path is not available in stack traces - for example exceptions in Android (Java and Kotlin), Java server and Unity (C#) projects.
For example - if you have a method saveBasket
belonging to the OrderSummary
class in the com.example.orders
package, the fully qualified method name would appear in BugSnag as com.example.orders.OrderSummary.saveBasket
. In this case you may wish to setup an assignment rule to assign the error to your ‘Orders’ team using the glob pattern com.example.orders.**
. This would also match any other errors originating from the com.example.orders
package or its subpackages.
This is a selection of fields that are sent by default with an error, for example context
, user.id
etc. Note that this does not include custom metadata.
Enter the value you wish to match to the field. Value matching is exact but case insensitive.
To automatically assign errors based on custom metadata you will need to use dot notation prepended with metaData
- so if you have a tab in the error details page named owners
and that tab had the property owner
you would reference this using metaData.owners.owner
.
Enter the value you wish to match to the field. Value matching is exact but case insensitive.
Automatic assignment rules are checked for matches the first time an error occurs; the error will not be reassigned when subsequent events are received, even if you change the collaborator or team to which the rule is assigned.
Order is important. Rules are applied in order until a match is made. Drag and drop rules to change the order.
In general, more specific rules should be higher up the list. For example you might have /src/components/cart/cart.tsx
towards the top, then **/*.tsx
lower down if you wanted a fallback catch-all rule for .tsx files.
For larger projects, you may wish to update your automatic error assignment rules programatically - for example to keep the rules in sync with a CODEOWNERS.md
file.
The BugSnag data access API has an endpoint which you can use to bulk update all of your error assignment rules.