Closed matthewnessworthy closed 1 year ago
Hi Matthew,
Thank you for providing the debug log. I see why you are getting this error message, and I'm currently trying to reproduce the issue. However, it led to nothing currently...
Can I ask you some questions for reproducibility purposes?
Hi @PROFeNoM, We're running Laravel 9 & 10 (different apps, same error), with the built-in MonoLog error logging library.
Here are the only snippets in the app where we interact with DD directly
if (
($rootScope = \DDTrace\GlobalTracer::get()->getRootScope())
&& ($rootSpan = $rootScope->getSpan())
) {
$rootSpan->setTag('domain', (string) $domain);
}
if (
($rootScope = \DDTrace\GlobalTracer::get()->getRootScope())
&& ($rootSpan = $rootScope->getSpan())
) {
$rootSpan->setMetric('php.mem.peak_usage_bytes', memory_get_peak_usage(false));
$rootSpan->setMetric('php.mem.peak_real_usage_bytes', memory_get_peak_usage(true));
}
if (
($rootScope = GlobalTracer::get()->getRootScope())
&& ($rootSpan = $rootScope->getSpan())
) {
$rootSpan->setTag('domain', (string) tenant('slug'));
$rootSpan->setTag('http.referer', $request->header('HTTP_REFERER'));
$rootSpan->setTag('http.request_id', $request->server('HTTP_X_REQUEST_ID'));
$rootSpan->setTag('http.useragent', $request->userAgent());
}
try {
if (function_exists('\DDTrace\current_context')) {
// @see https://docs.datadoghq.com/logs/log_collection/php/?tab=phpmonolog#laravel
$context = \DDTrace\current_context();
$record['dd']['trace_id'] = $context['trace_id'];
$record['dd']['span_id'] = $context['span_id'];
}
} catch (Throwable $e) {
$record['dd']['context_error'] = $e->getMessage();
}
Hey @matthewnessworthy!
It looks like @bwoebi may have found out about your issue. Would it be possible for you to try out the corresponding artifact and see if it solves the problem? Let us know if there's anything else we can do to assist you.
🔧 Just in case you are not familiar with using the artifact, you simply need to replace the link of the installer (datadog-setup.php
) to be the one provided above (generated here).
Able to reproduce this on php 8.1
and dd-trace-php 0.90.0
. Our usage is as simple as:
dd_trace_method(
CController::class,
'getViewFile',
function ($span, array $args, string $result, $exception) {
$span->service = 'monolith-app';
$span->name = 'getView.file';
$span->resource = $result;
},
);
Full log:
NOTICE: PHP message: Can't pass less args to an untyped function than originally passed (minus extra args) in /opt/datadog/dd-library/0.90.0/dd-trace-sources/bridge/_generated_integrations.php:2054
@matthewnessworthy did @PROFeNoM 's suggestion work? Or did you resolve this some other way?
Following up here, we isolated the issue to our usage of JIT with php8. Particularly, this exact addition to php.ini
caused this log to be spammed:
opcache.jit_buffer_size=512M
opcache.jit=1255
I'm not sure if this helps @bwoebi or @PROFeNoM
Bug report
PHP version
8.1
Tracer or profiler version
0.90.0
Installed extensions
No response
Output of
phpinfo()
No response
Upgrading from
0.89.1