-
Notifications
You must be signed in to change notification settings - Fork 373
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
Respect child_of: option in Tracer#trace #1082
Conversation
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 change makes a lot of sense. Nice work with the tests, too.
We'll need to rebase and rerun tests after Excon is fixed, to make sure this doesn't cause any problems elsewhere in CI. Otherwise though, I'm happy with this, and it should be good to merge.
@DocX could you please rebase with master? The |
It is documented behaviour in Getting Started guide, however the implementation did not respect it and always used the current context instead, even if the option was passed. This change makes passing `child_of:` option to `Tracer.trace` effective.
71bd093
to
af40d0f
Compare
@marcotc merged :) |
@marcotc Hi, can you please help me with the failing tests? I can't figure out why is it failing :( |
From a glance, it looks like in Rails the traces are not being constructed as expected... I see some differences in an array of @marcotc should be able to follow up with you soon on this, if you still need more help. |
I tried to test the failed examples, but when run alone they don't fail. So it seems there is some inter-example dependency or leak of some state:
|
Hey @DocX, I figured out what the issue is.
Because we modify the provided options Hash, e.g. options[:child_of] = call_context , we were passing in polluted data to the #trace .
This wasn't an issue before because we were always overriding I wrote a fix for the affected call site (it's only one affected in our code base thankfully). I thought about pushing a separate PR for it, but I believe it makes the most sense to be shipped with your PR. Could you please include this commit in this PR? 8f33959 |
@marcotc thanks for the help! i've added your commit to this PR :) |
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.
Thank you so much for this work @DocX! 🚀
It is documented behaviour in Getting Started guide, however the implementation did not respect it and always used the current context instead - even if the option was passed.
This change makes passing
child_of:
option toTracer.trace
effective.