Http Requests Monitoring
Monitor your application behaviour during incoming http requests.
Last updated
Monitor your application behaviour during incoming http requests.
Last updated
To activate inspection when your application is executed by an incoming http request you can use the WebRequestMonitoring
middleware.
Thanks to the middleware you are free to decide on which routes you want activate monitoring, based on your routes configuration or on your personal monitoring preferences. WebRequestMonitoring
middleware works like any other Laravel middleware you are familiar to.
You should append the Inspector middleware in the bootstrap/app.php
file for web
and api
middleware groups, so in two lines of code you'll intercept all incoming http requests:
For previous Laravel version up to 10 you should append the Inspector middleware to the middleware gourps in the App\Http\Kernel
class:
In alternative you can assign the middleware to specific routes or group:
If you need to implement a custom logic to ignore requests, the middleware is also designed to be extended.
Overwriting the shouldRecorded()
method, you can implement a custom condition to decide which routes should be ignored by Inspector.
Run the artisan command below to create a new middleware class:
In the new middleware class extend the Inspector middleware and override the shouldRecorded()
method to implement your condition. Return back a boolean value to enable or disable monitoring:
Returning true
the current http request will be recorded in your dashboard, returning false
the transaction will be completely ignored.
The last step is to use this new custom middleware instead of the original Inspector middleware.
You may hide sensible data from HTTP requests body and Headers like passwords, authorization token, etc. Inspector is able to detect that parameters in your request's content masking them with "******".
Simply add fields to the hidden_parameters
array in the in inspector config file:
You can specify nested fields using the dot notation like user.password
Basic ignoring logic is supported by default via a simple configuration parameter. .