class Test::Propagation::TextMapCodec
Constants
- PARENT_SPAN_ID
- SPAN_ID
- TRACE_ID
Public Instance Methods
extract(carrier)
click to toggle source
# File lib/test/propagation/text_map_codec.rb, line 14 def extract(carrier) trace_id = carrier[TRACE_ID] span_id = carrier[SPAN_ID] parent_span_id = carrier[PARENT_SPAN_ID] if trace_id && span_id SpanContext.new(trace_id: trace_id, span_id: span_id, parent_span_id: parent_span_id) end end
inject(span_context, carrier)
click to toggle source
# File lib/test/propagation/text_map_codec.rb, line 8 def inject(span_context, carrier) carrier[TRACE_ID] = span_context.trace_id carrier[SPAN_ID] = span_context.span_id carrier[PARENT_SPAN_ID] = span_context.parent_span_id end