diff --git a/agent/php/ElasticApm/Impl/AutoInstrument/CurlHandleTracker.php b/agent/php/ElasticApm/Impl/AutoInstrument/CurlHandleTracker.php index a4c6fbbe2..b56a20498 100644 --- a/agent/php/ElasticApm/Impl/AutoInstrument/CurlHandleTracker.php +++ b/agent/php/ElasticApm/Impl/AutoInstrument/CurlHandleTracker.php @@ -428,6 +428,11 @@ private function curlExecPreHook(): void $this->setContextPreHook(); + // Special case to skip distributed tracing for WordPress cron. + if ($this->url !== null && parse_url($this->url, PHP_URL_PATH) === '/wp-cron.php') { + return; + } + if ($isHttp) { $headersToInjectFormattedLines = []; $this->span->injectDistributedTracingHeaders(