Open rodion-k opened 2 hours ago
PHP SDK
In the consumer instrumentation example, the $job variable is used before initialization:
$context = \Sentry\continueTrace( $job->getMetadata('sentry_trace'), // $job variable is used here $job->getMetadata('baggage') ) ->setOp('queue.process') ->setName('App\Jobs\MyJob'); $transaction = \Sentry\startTransaction($context); \Sentry\SentrySdk::getCurrentHub()->setSpan($transaction); $job = Queue::pop(); // but initialization is here try { // Continue job processing... } catch (\Throwable $e) { $transaction->setStatus(\Sentry\Tracing\SpanStatus::internalError()); } $transaction ->setData([ 'messaging.message.id' => $job->getId(), 'messaging.destination.name' => $job->getQueue(), 'messaging.message.body.size' => $job->getSize(), 'messaging.message.receive.latency' => microtime(true) - $job->getMetadata('publish_time'), 'messaging.message.retry.count' => $job->getRetryCount(), ]) ->finish();
https://docs.sentry.io/platforms/php/guides/symfony/tracing/instrumentation/queues-module/#consumer-instrumentation
No response
Assigning to @getsentry/support for routing ⏲️
SDK
PHP SDK
Description
In the consumer instrumentation example, the $job variable is used before initialization:
https://docs.sentry.io/platforms/php/guides/symfony/tracing/instrumentation/queues-module/#consumer-instrumentation
Suggested Solution
No response