Grouping Patterns
How to customize the transactions and errors grouping strategy
Introduction
Grouping patterns are custom rules to help you group similar items together overcoming the limitations of the Inspector's standard grouping strategy. You can create custom patterns for both Transactions and Errors, so you have maximum flexibility on the way data are reported in your dashboard.
Errors Settings
With grouping patterns you can register custom rules to group similar errors together. The typical use case is errors that repeat themselves with only small differences within the message, such as a date, an ID, but the occurrences always refers to the exact same error.
The dynamic part of the error's message must be delimited by curly brackets {...}. You can also use multiple slots to parametrize multiple parts of the error message:
Invalid datetime format: 1292 Incorrect date value: {date} for column {column_name}_at
Add an Error Pattern
Navigate in the App -> Settings -> Errors Settings
section. In the top right corner of the transactions list you'll find the orange button to open the grouping pattern form.

Type your desired pattern in the form and click Save.

Transaction Settings
Since it is not always possible to identify the original signature of the endpoints within the application, you may see a different transaction generated for each URL parameter in the endpoint. Take a look at the example below:
GET /api/users/123/profile
GET /api/users/56/profile
GET /api/users/824/profile
It is actually the same endpoint where only the user ID changes.
Creating the pattern GET /api/users/{user_id}/profile
you can instruct Inspector to group all these transactions together.
The dynamic part of the transaction's name must be delimited by curly brackets ({...}), such as {user_id}
in the example above.
You can also use multiple parameters inthe same string like:
GET
/api/users/{user_id}/projects/{project_id}
.
Add a Transaction pattern
Navigate in the App -> Settings -> Transactions Settings
section. In the top right corner of the transactions list you'll find the orange button to open the grouping pattern form.

Type your desired pattern in the form and click Save.

It can require some minutes to become active. Checkout your transactions list to verify if Inspector start grouping transactions as you expect.
Last updated