[9.x] Request lifecycle duration handler #44122
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is in a similar spirit the the cumulative query duration PR. It allows developers to easily handle when an application request lifecycle exceeds a certain threshold.
The feature includes the duration of the request handle method and the terminating of the middleware and application.
This gives developers a nice hook around the entire lifecycle of the request, as seen: https://github.com/laravel/laravel/blob/c1dc4199b83466a3a6a8c70953250b0e2ec70001/public/index.php#L51-L55
This is an easy starting point for tracking slow requests and not a full blown replacement for APM, but gives developers some quick insight into their system with little to no extra knowledge / setup.
The handler is invoked after the request has been returned to the user.
Command compliment: #44125