Skip to content
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

Merged
merged 4 commits into from
Nov 29, 2017

Conversation

ufoot
Copy link
Contributor

@ufoot ufoot commented Nov 23, 2017

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.

@ufoot ufoot added the bug Involves a bug label Nov 23, 2017
@@ -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
Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 70f018f

@ufoot ufoot added this to the 0.10.0 milestone Nov 24, 2017
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.
@p-lambert p-lambert force-pushed the christian/noprioritywhendisabled branch from 5d58222 to 70f018f Compare November 28, 2017 21:08
p-lambert
p-lambert previously approved these changes Nov 28, 2017
if span.context.sampling_priority
req.add_field(
Datadog::Ext::DistributedTracing::HTTP_HEADER_SAMPLING_PRIORITY,
span.context.sampling_priority
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@palazzem palazzem merged commit a7d4ae9 into master Nov 29, 2017
@palazzem palazzem deleted the christian/noprioritywhendisabled branch November 29, 2017 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants