DataDog / dd-trace-php

Datadog PHP Clients
https://docs.datadoghq.com/tracing/setup/php
Other
487 stars 152 forks source link

[Feature] Support RoadRunner HttpWorker #1858

Closed adrien-f closed 1 year ago

adrien-f commented 1 year ago

Greetings!

Is your feature request related to a problem? Please describe.

When using Roadrunner and baldinof/roadrunner-bundle, the current integration is not loaded because it's made to hook into Spiral\RoadRunner\Http\PSR7Worker see here while the bundle uses Spiral\RoadRunner\Http\HttpWorker see here

The reasons for using the HttpWorker directly appears to be for simplification and performance: https://github.com/Baldinof/roadrunner-bundle/issues/29#issuecomment-790426181

Moreover, the PSR7Worker actually wraps on the HttpWorker: https://github.com/spiral/roadrunner-http/blob/master/src/PSR7Worker.php#L102

Describe the solution you'd like

We would like the Roadrunner integration to support the HttpWorker

Describe alternatives you've considered

The other Symfony package is https://github.com/php-runtime/roadrunner-symfony-nyholm which will use the Psr7 worker, but the Baldinof/roadrunner-bundle brings a lot of extra features we could use, such as Temporal (which I heard you might be a big user) and some other features of Roadrunner.

Additional context

I'd be open to contributing to the change if we can find a way forward 🙏 Thank you in advance!

Internal Support Ticket: 1066454

adrien-f commented 1 year ago

Hello @bwoebi

I might be wrong but does it need to be changed here as well so it's loaded when needed? https://github.com/DataDog/dd-trace-php/blob/056139d74273f43420e516768d9579ca021d804e/ext/integrations/integrations.c#L199

bwoebi commented 1 year ago

You are right :-) My bad, I forgot to update the autoloading for integrations.

bwoebi commented 1 year ago

@adrien-f I'll not immediately release a new version, but in the meantime, you can just manually explicitly load the integration via \DDTrace\Integrations\Roadrunner\RoadrunnerIntegration::init();.