Comment on page

Custom Segments

Monitor code blocks in your application
Once you have registered the middleware it decorates the request with the inspector service instance.
The new inspector property allows you to use the service inside your application to report custom segments and errors.

Add custom segments

For a better understanding of what segments are you can take a look at the custom segments section in the documentation.
You can retrieve the inspector instance from the request object to interact with segments:
request.inspector.start_segment('name', 'label')
// Your code block here
Here is how the execution of the code block is rendered in the dashboard.
The new segment in the timeline