Skip to content

Queue jobs traces do not keep context modifications #690

Closed
@slkolesov

Description

@slkolesov

Hi!

The package is amazing and helps a lot. Thanks a lot for all of the hard work!

Environment

The problem I see after upgrading to Laravel 10.9.0 & sentry-laravel 3.4.0 is that customs tags and other context modifications are not saved in the traces of jobs. Which was not the case when running sentry-laravel 2.14.2 with Laravel 9.

Steps to Reproduce

  1. Enable tracing in sentry.php config: queue_job_transactions=>true & queue_jobs=>true.
  2. Add custom tags inside Job::handle() method with \Sentry\configureScope
  3. Dispatch the job - no matter sync/async.

Expected Result

I expect my custom tags to appear in Sentry in Performance > Transaction Summary > Event Details.

Actual Result

No custom tags are being recorded.

The Reason

I suppose this happens because the context is being reset EventHandler::cleanupScopeForTaskWithinLongRunningProcessWhen before the transaction is sent to Sentry.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions