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
Correct way to trace a plain function #113
Comments
Hi @NickStallman, thank you for taking some time to contribute to this project.
What you wrote looks correct. I sort of replicated it in a script and the results are below.
It outputs
Would it be possible for you to share the remaining part of the sample script?
Calling Thanks!!! |
Very odd, I'm trying it out in place in a application on a dev server which probably isn't helping. https://github.com/NickStallman/dd-trace-php/blob/curl/src/DDTrace/Integrations/Curl.php An echo above the dd_trace works just fine, an echo inside it never executes and I've confirmed the dd_trace is being run before I'm running curl_exec. A second pair of eyes would be welcome. :) |
Hey! Once again your code looks good. This is how a suggest to proceed to debug the issue.
I expect that this is not working, though.
Thanks again @NickStallman for the patience and the detailed info! |
I've tried above snippet on all of our test docker images, and so far its working as expected. @NickStallman would you be able to share the output of |
Curious, that test script isn't working for me. Good to know I'm not going crazy.
I've tried this with file_get_contents as well as a second check, and it fails the same way. OS: Ubuntu 16.04.2 LTS x64 php -m [Zend Modules] |
@NickStallman I was able to reproduce the problem using PHP 7.1 on Ubuntu 16.04. |
@NickStallman we've shipped the fix from #126 in our latest release 0.4.1. |
@NickStallman did you have a chance to test version 0.4.1 which brings the fix for this issue? Is it working for you? |
@NickStallman we are closing for now this issue as it is supposed to be fixed in 0.4.1. If you have a chance to test if this is also fixed in your env it would be great. If you still see any problem we will reopen this issue. |
@labbati sorry, I've been on holidays. Yes I can confirm that this issue is fixed and I can now trace internal functions just fine. |
Thanks for confirming this! And welcome back from holidays 😄 |
I've got dd_trace working well with class methods however I'm trying to make an integration for Curl which requires attaching to "curl_exec" and it doesn't appear to be working.
It looks like this code should work (very short example):
But when I do that, no code in the closure is ever executed.
Also I'm a little unclear of how to call the original function. With classes $this is used but I'm not sure whether calling curl_exec inside the closure will make a infinite loop or if it'll execute the function.
Thanks
The text was updated successfully, but these errors were encountered: