Monitor code blocks in your application
Once you have registered the middleware it decorates the request with the current inspector class instance.
inspectorproperty allows you to use the service inside your application to report custom segments and errors.
For a better understanding of what segments are you can take a look at the add segment section of the python module.
Thanks to Inspector you can put everything you want in the transactions timeline getting a real-time feedback about the execution of a code block inside your application.
Some ideas on how to use custom segments:
- Http call to external services (webhooks, integrations, etc.);
- Functions that deal with files (pdf, excel, images);
- Data manipulation processes (import/export, data aggregation, etc).
Inside the application you can retrieve the inspector instance from the request object to add your custom segment:
// Your code block here
The new segment in the timeline