celery: allow using links instead of child spans for task execution#4537
Conversation
a6a3407 to
3baceda
Compare
3baceda to
033fabe
Compare
|
@tammy-baylis-swi @MikeGoldsmith would either of you be able to take a look at this if you get some spare time please? I've noticed you've both been active with celery instrumentation reviews recently. It's been previously approved by @Kludex on #3779 but was closed due to no second review a while ago. |
|
Thanks for the PR! Just a heads-up: we no longer update Please add the appropriate changelog fragment for this change instead of editing |
|
Thank you for your patience @jlc-christie . I think having this as an opt-in to better meet semantic conventions makes sense. If it's not too much trouble it would be nice if the docker tests also tested this feature. Else I think this looks good after addressing the |
Description
Duplicate of closed (stale, lack of reviews) PR #3779 since I lack the permissions to re-open.
As described in #3002, the current default behaviour results in all celery tasks that execute are child spans of the code that pushed it on to the broker, which conflicts with the semantic conventions.
This PR doesn't change the default behaviour since this may be undesirable for consumers expecting the behaviour to be consistent.
Fixes #3002 by providing an optional parameter to the
.instrument()method to allow for optionally using span links, e.g.Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
use_links=Falseand alsouse_links=Trueand observed the expected behaviour: when the flag isFalse(default) all task executions of a fan-out job are child spans of the code that enqueued it and whenTruethey appeared as linked spans.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.