diff --git a/lib/ddtrace/contrib/faraday/middleware.rb b/lib/ddtrace/contrib/faraday/middleware.rb index 08f85eaa6be..a5bc3545b56 100644 --- a/lib/ddtrace/contrib/faraday/middleware.rb +++ b/lib/ddtrace/contrib/faraday/middleware.rb @@ -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.span_id + Ext::DistributedTracing::HTTP_HEADER_TRACE_ID => span.trace_id.to_s, + Ext::DistributedTracing::HTTP_HEADER_PARENT_ID => span.span_id.to_s ) end diff --git a/test/contrib/faraday/middleware_test.rb b/test/contrib/faraday/middleware_test.rb index 09cab53b564..006a8b8d60e 100644 --- a/test/contrib/faraday/middleware_test.rb +++ b/test/contrib/faraday/middleware_test.rb @@ -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.span_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