Skip to content
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

Skip Distributed Tracing for WordPress Cron #1041

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xyu
Copy link

@xyu xyu commented Aug 10, 2023

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.

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.
@v1v
Copy link
Member

v1v commented Feb 9, 2024

run docs-build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants