From 82ac4ca98b0afbbb6392b73e735e1950b053ad77 Mon Sep 17 00:00:00 2001 From: Emanuele Palazzetti Date: Mon, 2 Oct 2017 15:23:56 -0700 Subject: [PATCH] [faraday] distributed tracing headers must be string --- lib/ddtrace/contrib/faraday/middleware.rb | 4 ++-- test/contrib/faraday/middleware_test.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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