-
Notifications
You must be signed in to change notification settings - Fork 91
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
Laravel: tracing Queues (+ hook refactoring) #250
Laravel: tracing Queues (+ hook refactoring) #250
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #250 +/- ##
============================================
- Coverage 84.38% 82.47% -1.92%
+ Complexity 983 648 -335
============================================
Files 89 61 -28
Lines 3946 2630 -1316
============================================
- Hits 3330 2169 -1161
+ Misses 616 461 -155
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 40 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
c711610
to
d76534d
Compare
41c6a62
to
69117c8
Compare
cf5bd87
to
17ad05f
Compare
src/Instrumentation/Laravel/tests/Integration/Queue/QueueTest.php
Outdated
Show resolved
Hide resolved
src/Instrumentation/Laravel/src/Hooks/Illuminate/Queue/Worker.php
Outdated
Show resolved
Hide resolved
"require": { | ||
"php": "^8.0", | ||
"ext-json": "*", | ||
"ext-opentelemetry": "*", | ||
"laravel/framework": ">=6.0", | ||
"laravel/framework": "^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Source: https://laravel.com/docs/11.x/releases#support-policy
Listing the currently supported versions explicitly. I'd like to drop versions 6-9 after we make a 1.0 release of the package so that we can align with the API on PHP ^8.1.
Tracing Laravel Queues
I have added some message tracing to Laravel.
Ref: https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/
An example trace:
The above screenshot was produced with the following Laravel test code:
and the following test job:
This is an example of a successful read from the queue:
Trace whereby no message received, thus the span was dropped:
I tried linking this span to a different parent by extracting the traceparent, but it didn't seem possible to change the existing span's parent.
Refactoring
During the course of this PR, I decided to try and organise the numerous additional hooks in a way which reflects the layout of the Laravel framework. I hope that this might ultimately make it easier to add further hooks in future.