Closed B-Galati closed 7 months ago
If I understand correctly, the problem is that the span contains a error where the command likely executed normally (when shell_exec
returns null it can be error or simply no output), right? Or do you have other concerns? You say that "[i]t's not possible to understand the command that was run for example", but the example you show includes the command run (stty 2> /dev/null
).
@cataphract Hi! I am sorry I misunderstood how it works :+1:
I think I understand the purpose of this new feature and it can be quite useful actually.
At the moment I am missing a stack trace to understand where the error comes from but that does not sound doable.
And you're right for shell_exec
but it's actually PHP that has an ambiguous behavior on this.
:arrow_right: I am sorry for the noise, I am closing that issue :pray:
If I understand correctly, the problem is that the span contains a error where the command likely executed normally (when
shell_exec
returns null it can be error or simply no output), right? Or do you have other concerns?
We have encountered the same and that's precisely the concern in our case. Null does not indicate an error, however it's being traced as such. Well, not always.
We are using Symfony commands via cron (which looks to be the case for @B-Galati as well) and there are a number of functionality/mode checks using shell_exec.
However, there appears to be a nuance I am not understanding. Not all shell_exec()
returning null are traced as an error. Not all Symfony commands are affected (of which we have many!) and executing the php cli manually does not indicate an error in the trace:
DD_TRACE_CLI_ENABLED=1 DD_SERVICE=test_cli php -r 'var_dump(shell_exec("export foo=bar"));'
# NULL
Resulting trace:
Additionally, just to check, there is no change in the trace even if there is indeed an error with the shell_exec()
:
DD_TRACE_CLI_ENABLED=1 DD_SERVICE=test_cli php -r 'var_dump(shell_exec("cat /file/does/not/exist"));'
# cat: /file/does/not/exist: No such file or directory
# NULL
I'm not sure which criteria, configuration, or invocation method with shell_exec()
returning NULL marks the trace as an error versus not.
Bug report
Hi!
Since we upgraded to version 0.98.1 we have a new operation called
command_execution
that creates some noise because it contains traces with very very few information. It's not possible to understand the command that was run for example.For the moment we disabled it with
DD_TRACE_EXEC_ENABLED=false
.Here are some screenshots:
PHP version
8.3.3
Tracer or profiler version
0.98.1
Installed extensions
No response
Output of
phpinfo()
No response
Upgrading from
0.96.0