Skip to content

Fix Rack http_server.queue spans missing from distributed traces#709

Merged
brettlangdon merged 1 commit into
0.20-devfrom
fix/rack_http_server_queue_for_distributed_tracing
Mar 7, 2019
Merged

Fix Rack http_server.queue spans missing from distributed traces#709
brettlangdon merged 1 commit into
0.20-devfrom
fix/rack_http_server_queue_for_distributed_tracing

Conversation

@delner

@delner delner commented Mar 7, 2019

Copy link
Copy Markdown
Contributor

If a Rack application was on the receiving end of a distributed trace (e.g. 2nd service in chain), and it had enabled request_queuing, then the http_server.queue span did not receive the distributed trace ID and parent ID because it was processed before distributed tracing was. The span would instead end up in its own trace.

This pull request moves the distributed tracing operation to the top, so http_server.queue spans end up with the correct distributed tracing metadata, and are included into the trace.

@delner delner added bug Involves a bug integrations Involves tracing integrations labels Mar 7, 2019
@delner delner self-assigned this Mar 7, 2019
@delner
delner requested a review from brettlangdon March 7, 2019 15:21
Comment thread lib/ddtrace/contrib/rack/middlewares.rb Outdated
brettlangdon
brettlangdon previously approved these changes Mar 7, 2019

@brettlangdon brettlangdon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A comment on why that block had to be moved, but otherwise this is great!

@brettlangdon brettlangdon modified the milestone: 0.20.0 Mar 7, 2019
@delner
delner force-pushed the fix/rack_http_server_queue_for_distributed_tracing branch from 50fb96a to 296a107 Compare March 7, 2019 15:37
@delner
delner changed the base branch from master to 0.20-dev March 7, 2019 15:38
@delner

delner commented Mar 7, 2019

Copy link
Copy Markdown
Contributor Author

@brettlangdon Rebased and ready for review again.

@brettlangdon
brettlangdon merged commit 38e3622 into 0.20-dev Mar 7, 2019
@brettlangdon
brettlangdon deleted the fix/rack_http_server_queue_for_distributed_tracing branch March 7, 2019 16:35
@brettlangdon brettlangdon mentioned this pull request Mar 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Involves a bug integrations Involves tracing integrations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants