lib/elastic_apm/spies/faraday.rb in elastic-apm-2.1.2 vs lib/elastic_apm/spies/faraday.rb in elastic-apm-2.2.0

- old
+ new

@@ -24,14 +24,13 @@ name = "#{method.upcase} #{host}" type = "ext.faraday.#{method}" ElasticAPM.with_span name, type do |span| ElasticAPM::Spies::NetHTTPSpy.disable_in do - id = span&.id || transaction.id + trace_context = span&.trace_context || transaction.trace_context run_request_without_apm(method, url, body, headers) do |req| - req['Elastic-Apm-Traceparent'] = - transaction.traceparent.to_header(span_id: id) + req['Elastic-Apm-Traceparent'] = trace_context.to_header yield req if block_given? end end end