Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Laravel Octane requests as laravel.request #2655

Merged
merged 3 commits into from
May 3, 2024

Conversation

PROFeNoM
Copy link
Contributor

@PROFeNoM PROFeNoM commented May 3, 2024

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:
image

Therefore, this PR changes the operation name of Laravel octane requests (Swoole, Roadrunner, and beyond) from web.request to laravel.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 experience


Technically, 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 the requeststart event callback (hence ensuring laravel.request is not overwritten by web.request from the SwooleIntegration).

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@PROFeNoM PROFeNoM self-assigned this May 3, 2024
@PROFeNoM PROFeNoM marked this pull request as ready for review May 3, 2024 08:15
@PROFeNoM PROFeNoM requested review from a team as code owners May 3, 2024 08:15
@codecov-commenter
Copy link

codecov-commenter commented May 3, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 79.20%. Comparing base (8388bc1) to head (b93f695).
Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2655      +/-   ##
============================================
+ Coverage     77.66%   79.20%   +1.54%     
- Complexity     2205     2206       +1     
============================================
  Files           225      199      -26     
  Lines         26019    22014    -4005     
  Branches        988        0     -988     
============================================
- Hits          20208    17437    -2771     
+ Misses         5285     4577     -708     
+ Partials        526        0     -526     
Flag Coverage Δ
appsec-extension ?
tracer-extension 78.47% <ø> (ø)
tracer-php 80.24% <50.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...DTrace/Integrations/Laravel/LaravelIntegration.php 81.06% <50.00%> (-1.15%) ⬇️

... and 26 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8388bc1...b93f695. Read the comment docs.

@PROFeNoM PROFeNoM marked this pull request as draft May 3, 2024 08:17
@pr-commenter
Copy link

pr-commenter bot commented May 3, 2024

Benchmarks

Benchmark execution time: 2024-05-03 09:40:00

Comparing candidate commit b93f695 in PR branch alex/style/swoole-laravel-request with baseline commit 8388bc1 in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 177 metrics, 0 unstable metrics.

scenario:SamplingRuleMatchingBench/benchRegexMatching1-opcache

  • 🟩 execution_time [-412.093ns; -186.107ns] or [-6.514%; -2.942%]

@PROFeNoM PROFeNoM marked this pull request as ready for review May 3, 2024 09:30
@PROFeNoM PROFeNoM merged commit 6b62162 into master May 3, 2024
555 of 556 checks passed
@PROFeNoM PROFeNoM deleted the alex/style/swoole-laravel-request branch May 3, 2024 12:51
@bwoebi bwoebi added this to the 1.0.0 milestone May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants