apm-agent-php icon indicating copy to clipboard operation
apm-agent-php copied to clipboard

Skip Distributed Tracing for WordPress Cron

Open xyu opened this issue 1 year ago • 1 comments

WordPress will sometimes make a call to /wp-cron.php on shutdown to trigger scheduled actions. These actions are almost never related to the request that makes the request because they simply are just triggered after some time passes until a request gets "lucky". The actions that a WP cronjob ends up doing is also almost never related to the request that ends up triggering it as it's more akin to a deferred jobs system.

Given all this it does not make sense to try and relate the actions of a /wp-cron.php call with the request that triggered it via distributed tracing. Here we exit early and skip setting the distributed tracing headers so that WP cron calls show up as seperate transactions not child transactions of some unrelated HTTP call.

xyu avatar Aug 10 '23 20:08 xyu

run docs-build

v1v avatar Feb 09 '24 08:02 v1v