Skip Distributed Tracing for WordPress Cron #1041
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.