Mark Laravel Octane requests as laravel.request
#2655
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.
Description
As surfaced in #2636
Currently, the root span from Laravel octane requests' will be
web.request
.However, this can cause confusion on the Datadog UI, as the backend will most likely choose
laravel.request
as the primary operation, as seen from the screen below:Therefore, this PR changes the operation name of Laravel octane requests (Swoole, Roadrunner, and beyond) from
web.request
tolaravel.request
, so that it is consistent with the default Laravel behavior.This is a breaking change, but the next release is 1.0, right? 😉
Additionally, with this change, if
DD_SERVICE
isn't set, then the request will use Laravel's APP_NAME instead of 'swoole', which is a better experienceTechnically, I'm hooking
Laravel\Octane\Worker::handle
as it is guaranteed to happen for all incoming requests (Swoole, RR, etc.). What's more, it happens after the prehook set on therequeststart
event callback (hence ensuringlaravel.request
is not overwritten byweb.request
from the SwooleIntegration).Reviewer checklist