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
ddtrace/tracer: allow changes of priority even when the root is non-local #1241
Conversation
…ocal The tracer was not allowing the user to override the sampling decision in downstream services, causing a manual keep to not work for traces where the root span wasn't local.
IIRC the sampling decision for a trace can only be made with the initial chunk and it applies to the whole distributed trace. It is not allowed to set different sampling decisions for different parts of a trace. I'm pretty sure this was intended, as the comment you are trying to delete mentions too. |
Right, I probably should not have called it an issue but rather a requested behavior change, as you mentioned the intent behind the code is quite clear. The public documentation implies that if the user uses a manual keep/drop, the tracer will do its best to enforce it. It would be super useful to be allowed to keep specific errors occurring in downstream services, even if the resulting trace will be incomplete. Likewise, being able to drop uninteresting parts of traces explicitly would be nice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine. But left some comments to make sure we're aligned with the rest of the repository style (https://github.com/DataDog/dd-trace-go/wiki/Style-guidelines)
Co-authored-by: Gabriel Aszalos <gabriel.aszalos@gmail.com>
Thanks for all the comments/suggestions! I believe I addressed all of them. Also:
|
@dumontg 🙌 and yes |
The tracer was not allowing the user to override the sampling decision
in downstream services, causing a manual keep to not work for traces
where the root span wasn't local.
Notes:
ddtrace/tracer/spancontext.go
will fail. Those are an easy way to reproduce the issue on your end.