-
Notifications
You must be signed in to change notification settings - Fork 160
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
[Bug]: Missing php classes stubs #2931
Comments
I'm a bit confused here what you would like to see here. The *.stub.php files are for functions exposed by the extension, not the PHP source files shipped alongside it. I'd like to understand the usecase / workflow for this? For integration in the IDE, I just pull it via composer and it sees the stub files as well as all files in src/. |
I'd like though, to understand, why installing the extension is hard? I thought just downloading and executing About the size of the full artifact (containing all php versions), we've been annoyed too. I suppose the easiest way is to split this up into more individual files... |
Overall, we're also willing to hear what makes it hard to work with dd-trace-php. In fact, we mostly hear from our users when something is actually broken, but merely "hard to work with" is nothing I get to hear often. Feedback is important and most welcome too. |
Hi! @bwoebi Let's start from the files and stubs. The OpenTelemetry is relatively new feature for PHP and datadog, so I cannot tell if that would solve anything for us. Our usecase is that you just cannot enable tracing for everything to get more detailed info we have to provide spans and tags semi-manual. For that we use and more
So we could call it internal tooling-ish. Now the stubs are mostly important with two cases IDE and phpstan. It is a great PITA that the stubs don't consists of other elements. Those listed above are part of extension, but are not marked as internal, therefore they should usable. |
Another thing is partially what you mentioned with the package consisting all of the versions. That is very heavy on network and time-consuming. Example. I have to wait just for the datadog download about 15 minutes. That is with super nice internet (mostly the time comes from github API limits). So there are a couple of ways now to install the extension.
Like you can see something quite simple is either too complicated or waaay bigger. Probably if I were to tell you that you need to download 1GB, but you need just like 50MB from it you would call it strange 😢 We could save a lot of trees if the release file was matrix'ed by not only platform/arch but PHP version as well. Easy like that. |
Thanks @zbigniew-malcherczyk-tg, We quickly tried generating stubs in #2933. The resulting src/ddtrace_php_api.stubs.php contains all stubs for the PHP code, minus the extension stubs. I wonder, at that point, whether it would be preferable to have a single stub file instead of 4? (merging that one, ext/ddtrace.stub.php and ext/hook/uhook.stub.php and ext/hook/uhook_attributes.stub.php?) Also, do you wish to see that as a release artifact or rather just in the repository? |
Thank you for the stub's. The ideal scenario and usecase would be a separate composer package like phpstan-ddtrace or something, but a release artifact should be enough. Single stub file would improve the experience. |
Sounds good, we'll add some logic to compile a big stub file together and add it as artifact. |
Yea. packageist mostly supports single package single repository scenarios 😢 |
Release artifacts now have a |
To address these related things about
The # APM only
php datadog-setup.php --php-bin=all
# APM + Profiling
php datadog-setup.php --php-bin=all --enable-profiling
# APM + ASM
php datadog-setup.php --php-bin=all --enable-appsec
# Full installation: APM + ASM + Profiling
php datadog-setup.php --php-bin=all --enable-appsec --enable-profiling You can also use it to set INI settings, which is my preferred way to configure things (slightly modified from the profiler's Installation Docs): php datadog-setup.php config set --php-bin=all \
-d datadog.service="app-name" \
-d datadog.env="prod" \
-d datadog.version="1.3.2" If you want to env vars at runtime (like in docker or such) you can also do things like this, it's a little known feature of PHP INI settings: php datadog-setup.php config set --php-bin=all \
-d datadog.service="\$DD_SERVICE" \
-d datadog.env="\$DD_ENV" \
-d datadog.version="\$DD_VERSION" |
Bug report
There are a few missing stubs for version 1.4.2
Please. It's so hard to work with dd-trace library and extension. It's really sad how hard it is to install the extension, to maintain anything that depends on this lib. No to mention that release is 1GB...
PHP version
8.2.25
Tracer or profiler version
1.4.2
Installed extensions
No response
Output of
phpinfo()
No response
Upgrading from
No response
The text was updated successfully, but these errors were encountered: