You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Laravel queues with a redis driver, we expect that the jobs in the worker consumers
should have the same trace id as the launching transaction. In practice we see that the jobs
sometimes do not have the correct IDs resulting in the distributed trace not being complete in the NR UI.
In our production system we have a web handler that launches ~8 jobs to be processed by the workers,
often a couple of the jobs have the wrong trace ids. On average I'd say it happens to roughly half the jobs launched.
Steps to Reproduce
Create a laravel setup with worker instance using a redis QUEUE_DRIVER.
class TracePrintingQueue implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
public function handle(): void
{
$meta = newrelic_get_trace_metadata();
$stdout = fopen('php://stdout', 'w');
fwrite(\STDOUT, "Job Trace ID:" . $meta['trace_id'] . "\n");
}
}
Expected Behavior
Jobs handled asynchronously in the workers should appear under the parent trace within new relic UI.
Description
When using Laravel queues with a redis driver, we expect that the jobs in the worker consumers
should have the same trace id as the launching transaction. In practice we see that the jobs
sometimes do not have the correct IDs resulting in the distributed trace not being complete in the NR UI.
In our production system we have a web handler that launches ~8 jobs to be processed by the workers,
often a couple of the jobs have the wrong trace ids. On average I'd say it happens to roughly half the jobs launched.
Steps to Reproduce
Example code:
Web handler launching jobs:
Worker:
Expected Behavior
Jobs handled asynchronously in the workers should appear under the parent trace within new relic UI.
Relevant Logs / Console output
From the above sample code we see the output:
Note that the TraceIDs here are different lengths too which is odd.
Your Environment
Seen locally on mac m1 and linux alpine.
php 8.3
newrelic agent: 10.13.0.2 (is an issue on earlier versions too)
The text was updated successfully, but these errors were encountered: