-
Notifications
You must be signed in to change notification settings - Fork 375
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
[distributed tracing] disabling tracer disables distributed headers #254
Conversation
@@ -28,7 +28,7 @@ def initialize(app, options = {}) | |||
def call(env) | |||
dd_pin.tracer.trace(SERVICE) do |span| | |||
annotate!(span, env) | |||
propagate!(span, env) if options[:distributed_tracing] | |||
propagate!(span, env) if options[:distributed_tracing] && dd_pin.tracer.enabled |
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.
I think the test should wait for the merge of #229 and more precisely the introduction of WebMock https://github.com/DataDog/dd-trace-rb/pull/229/files#diff-b06e29a984e208fededfd0c6e60ca9ecR41 which could be very useful and straightforward to write a simple test for this.
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.
What test should we write?
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.
See 70f018f
When the tracer is disabled, the traces/spans are not sent, so we should not set the distributed tracing headers, else children called with these would refer to non-existing (never sent) parent traces.
5d58222
to
70f018f
Compare
70f018f
to
d0f1828
Compare
if span.context.sampling_priority | ||
req.add_field( | ||
Datadog::Ext::DistributedTracing::HTTP_HEADER_SAMPLING_PRIORITY, | ||
span.context.sampling_priority |
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.
👍
When the tracer is disabled, the traces/spans are not sent, so we
should not set the distributed tracing headers, else children called
with these would refer to non-existing (never sent) parent traces.