-
Notifications
You must be signed in to change notification settings - Fork 149
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
Tracing with async/CLI setups #704
Comments
Hi @SonarSoftware, we definitely have plans for ReactPHP as it came up a few times now, and I guess a similar solution might apply to Swoole as well, as you are suggesting. I cannot provide an ETA at the moment, though. Given that I am not expert about RactPHP/Swoole internals (I only can assume that there is some separate thread/event loop under the hood) this would make it difficult for you to support tracing without some work on our side due to the following reasons that comes to my mind (@SammyK and @morrisonlevi feel free to jump in as you might have more experience than me with those libraries):
Again, I have never used such libraries so I can only talk from the top of my head. |
Yes, it is tricky. There are some ways around the global tracer issue - Swoole for example has a sandbox that is used to separate per-request items out. That being said, it's still not easy and it would definitely take some work. It might be worth taking a look at https://github.com/upscalesoftware/swoole-newrelic for some inspiration - I've been poking at it a bit seeing if we can do something similar with ddtrace. |
Any update on this? I ask because we are in the process of migrating from NewRelic and ran into this. It is not an issue we expected to show up. |
I am not aware of any updates specific to ReactPHP or Swoole, but I know some of the underlying engineering challenges that assume a single global trace are being worked on. One thing to set expectations on is what in these products gets traced. To that end you could help by sharing what features you are using. As an example, I found a Another thing worth knowing is what PHP version and which version of Swoole or ReactPHP you are using, to make sure our work is actually relevant to what our users need. |
I believe we're using Also, thanks for the fast update. |
Yep, exactly. Just treat each request as independent. I think this might be fairly easy to do by hooking into the |
HI @morrisonlevi @labbati Could you provide us with an update on the work being done to make this possible? And would it maybe be possible to elaborate a little bit more on this:
As I'm currently looking into getting our distributed services through queueing connected to each other with tracing (we already have our logs connected through the same way with a |
Hi, any updates about this feature? Thanks! |
Hi @anderson-flores! At the moment we were not able to schedule the work for this and we cannot commit to a specific timeline. We will update as soon as possible. |
I guess I've got a similar problem with Laravel Horizon running for days on a server. It would be nice to trace jobs individually. |
Swoole and ReactPHP is gaining more and more traction. At the same time, we have Laravel Octane working with Swoole under the hood. It would be very great to speed up the support of the coroutines in Datadog. |
Hello, any updates? A year has passed and more and more swoole is gaining attention from the community, especially after the release of Laravel Octane and other packages with Swoole for Laravel, do we have any estimate when this will be implemented? Or if it won't be thks. |
We do not yet have concrete updates on this, except that it is on our roadmap to have at least the possibility of manual tracing of async applications by now (we expect some actual results regarding async surfacing this year) and new APIs are being designed with async in mind (e.g. the usage of a span stack like we currently have is inherently incompatible with async use cases). Concrete new integrations will be evaluated once support for async instrumenting has landed at all. |
We'd really really love to have this! |
Any news on tracing for Laravel Octane Swoole? |
I sadly have to repeat what I said in February. Hopefully basic fiber support, including simple async support will land within a couple months. Only then, we will be able to look into laravel octane or swoole. |
@bwoebi, thanks for the quick reply. |
Quick question, is this support with RoadRunner instead of Swoole? Or is this not support due to the async nature of Laravel? |
@bwoebi any news on this, in few weeks it will be 3 years since initial question ? quite some time |
In ddtrace 0.82.0, we added a Roadrunner integration. Bob will be unavailable until the New Year, and I am filling in as best as I can. I don't know what's on the roadmap, or what's blocking more Async/CLI setups, sorry! |
I set up ddtrace 0.82.0 in the Laravel Octane (Roadrunner) application, |
Hey @githubeto, |
@bwoebi ,
This is an application running on AWS Fargate, and the task definition also includes the following settings.
If I change the application server configuration to nginx + php-fpm instead of laravel octane(roadrunner), |
4 months passed since I asked and over 3 years since this issue was raised and we still got no answer about the roadmap. Will Datadog support apm on Swoole, ever ? Swoole is now super popular and I cant believe company like Datadog ignores it |
Hey @donparapidos, We are sorry for not supporting Swoole yet. However, your comment just prompted me into looking again into the swoole project. They seem to have committed support for the Zend Fiber API in swoole/swoole-src@a941e94, which was released in February in v5.0.2. Given that this support exists now, we are now able to put Swoole support with a higher priority on our roadmap! Thanks for bringing it to my attention again. :-) |
I haven't tested it, but I think just judging from that commit, that ddtrace should run on v5.0.2 without crashing (proper instrumentation is still missing, but there's a chance it will run at all). |
With the release of Horizon async queue support in 0.87.0, any chances we will see proper support for Octane soon? |
Any updates on Swoole support? We migrating from PHP-FPM to OpenSwoole with Laravel Octane and the performance gains are massive but then we lose Datadog support. |
OpenSwoole does not provide an API for tracking context switches. (Development seems also to be relatively quiet there.) With Swoole, we're targeting next quarter to have a closer investigation and possibly actual support. |
Any updates on this @bwoebi ? |
Same question, @bwoebi, any progress has been made in Swoole support ? |
4 years of no support for one of the popular deployment stacks for PHP applications, I can't believe a company like Datadog is ignoring this... |
@carlosevieira Looks like we will have it soon :-) |
Hi everyone 👋 The 0.99.0 release of the PHP Library added support for Swoole 🎉 Upgrading to the latest version of the tracer will create a trace for each individual request made to Swoole HTTP Servers without you having to perform any manual instrumentation. Should any issue arise, we encourage you to open a new Github Issue or contact our Support Team for assistance. We greatly appreciate your patience 🙏 |
Thansk for the release @PROFeNoM! Setting php.ini? |
Hi @sneycampos 👋 Typically, if you already have a Laravel Octane w/ Swoole app, you only have to upgrade the tracer. If the service is not yet instrumented, then you would have to download and install the tracer and forward it to your datadog-agent. I'll now give an example if this can help you out. curl -LO https://github.com/DataDog/dd-trace-php/releases/latest/download/datadog-setup.php
# APM only
php datadog-setup.php --php-bin=all and in your DD_TRACE_CLI_ENABLED: true
DD_AGENT_HOST: datadog-agent and a datadog-agent:
image: datadog/agent:latest
container_name: datadog-agent
environment:
DD_API_KEY: <YOUR_API_KEY>
DD_SITE: <YOUR_DD_SITE>
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /proc/:/host/proc/:ro
- /sys/fs/cgroup/:/host/sys/fs/cgroup:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro I extracted the above snippets from a sample Laravel Octane app with Swoole of mine, so that's just an example. It will ultimately depend on the specifics of your services, though. I'm happy to answer any specific questions you may have. If you are having trouble instrumenting your app, I greatly encourage you to either contact our Support Teams or create a GitHub Issue. I hope it helped 🙏 |
Thank you @PROFeNoM! Appreciate your help! I got the same result when tried a few days ago: made some requests to application, here a few logs
In datadog dashboard, i can't see any trace this time, in my tests a few days ago got only the first command (php artisan migrate) that my entrypoint script calls and request logs didn't get anything It appears in my infrastructure list | Containers I tried with your octane repository and got same results :/ |
Hi @sneycampos Thanks for coming up with all this information.
I'm afraid this is the root cause of your issue. Your image uses OpenSwoole, while our tracing library provides support for Swoole. As of today, it is not possible to provide support for OpenSwoole because it does not support Fibers, which are required for proper tracing and interception. When it comes to Laravel Octane, we are supporting:
Until OpenSwoole makes changes on their side, I'm afraid there is nothing that can be done on our side to provide proper support for OpenSwoole :( |
@PROFeNoM Thank you! |
@PROFeNoM could you share any dockerfile/docker-compose with agent and octane working? i tried with your repository (https://github.com/PROFeNoM/octane-demo/blob/main/docker-compose.yml) and didn't work too Tried too with the following image: |
I'm currently using Swoole, but I'm guessing it's a similar issue for ReactPHP. Is there any direction on getting it working on an environment like this today? Or any plans to implement?
The text was updated successfully, but these errors were encountered: