Skip to content

Commit

Permalink
[faraday] update the HTTP_HEADER_PARENT_ID to send the span_id instea…
Browse files Browse the repository at this point in the history
…d of parent_id (#212)
  • Loading branch information
Emanuele Palazzetti authored Oct 6, 2017
1 parent c17aea0 commit 6b8a28a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/ddtrace/contrib/faraday/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def handle_response(span, env)

def propagate!(span, env)
env[:request_headers].merge!(
Ext::DistributedTracing::HTTP_HEADER_TRACE_ID => span.trace_id,
Ext::DistributedTracing::HTTP_HEADER_PARENT_ID => span.parent_id
Ext::DistributedTracing::HTTP_HEADER_TRACE_ID => span.trace_id.to_s,
Ext::DistributedTracing::HTTP_HEADER_PARENT_ID => span.span_id.to_s
)
end

Expand Down
4 changes: 2 additions & 2 deletions test/contrib/faraday/middleware_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ def test_distributed_tracing
headers = response.env.request_headers
span = request_span

assert_equal(headers[Ext::DistributedTracing::HTTP_HEADER_TRACE_ID], span.trace_id)
assert_equal(headers[Ext::DistributedTracing::HTTP_HEADER_PARENT_ID], span.parent_id)
assert_equal(headers[Ext::DistributedTracing::HTTP_HEADER_TRACE_ID], span.trace_id.to_s)
assert_equal(headers[Ext::DistributedTracing::HTTP_HEADER_PARENT_ID], span.span_id.to_s)
end

private
Expand Down

0 comments on commit 6b8a28a

Please sign in to comment.