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

fix: Fix not listening to queue events because QueueManager is registered as queue in the container and not by it's class name #568

Merged
merged 3 commits into from Sep 29, 2022

Conversation

cloudop
Copy link
Contributor

@cloudop cloudop commented Sep 8, 2022

Fix doesn't send queue job transaction trace.
Because Laravel 8.X and Lumen 8.X regist queue manager:

$this->app->singleton('queue', function ($app) {
            // Once we have an instance of the queue manager, we will register the various
            // resolvers for the queue connectors. These connectors are responsible for
            // creating the classes that accept queue configs and instantiate queues.
            return tap(new QueueManager($app), function ($manager) {
                $this->registerConnectors($manager);
            });
});

see illumanate\queue\QueueServiceProvider.php registerManager
so
Tracing\ServiceProvider.php bindEvents

if ($this->app->bound(QueueManager::class)) {
            $handler->subscribeQueueEvents(
                $this->app->make(QueueManager::class)
            );
}

will always skip.

@stayallive stayallive changed the title fix doesn't send queue job transaction trace fix: Not listening for queue events on Laravel/Lumen 8.x Sep 29, 2022
@stayallive stayallive changed the title fix: Not listening for queue events on Laravel/Lumen 8.x fix: Fix not listening to queue events because QueueManager is registered as queue in the container and not by it's class name Sep 29, 2022
@stayallive
Copy link
Collaborator

Sorry this went so long without a response, this seems like a good fix, not sure when this changed or why this was not caught before. Thanks!

@stayallive stayallive merged commit 52e4011 into getsentry:master Sep 29, 2022
@cleptric cleptric added this to the 2.14.0 milestone Sep 30, 2022
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.

None yet

3 participants