lib/minato/trace/middleware/distributed_trace_context.rb in minato-trace-0.1.6.pre.7 vs lib/minato/trace/middleware/distributed_trace_context.rb in minato-trace-0.1.6.pre.8
- old
+ new
@@ -17,10 +17,12 @@
end
private
def add_trace_context_header(env)
- return unless (Rails.env.production? && Minato::Trace.enabled?) || current_cloud_trace.nil?
+ return unless Rails.env.production? && Minato::Trace.enabled?
+
+ return if current_cloud_trace.nil?
env.request_headers.merge!({ "#{TRACE_HEADER_KEY}": "#{current_cloud_trace.trace.trace_id};o=1" })
end
def current_cloud_trace