class Jaeger::Injectors::B3RackCodec

Public Class Methods

inject(span_context, carrier) click to toggle source
# File lib/jaeger/injectors.rb, line 40
def self.inject(span_context, carrier)
  carrier['x-b3-traceid'] = TraceId.to_hex(span_context.trace_id)
  carrier['x-b3-spanid'] = TraceId.to_hex(span_context.span_id)
  carrier['x-b3-parentspanid'] = TraceId.to_hex(span_context.parent_id)

  # flags (for debug) and sampled headers are mutually exclusive
  if span_context.flags == Jaeger::SpanContext::Flags::DEBUG
    carrier['x-b3-flags'] = '1'
  else
    carrier['x-b3-sampled'] = span_context.flags.to_s(16)
  end
end