Class: Jaeger::Extractors::JaegerTextMapCodec

Inherits:
Object
  • Object
show all
Defined in:
lib/jaeger/extractors.rb

Class Method Summary collapse

Class Method Details

.extract(carrier) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/jaeger/extractors.rb', line 27

def self.extract(carrier)
  context = SerializedJaegerTrace.parse(carrier['uber-trace-id'])
  return nil unless context

  carrier.each do |key, value|
    baggage_match = key.match(/\Auberctx-([\w-]+)\Z/)
    if baggage_match
      context.set_baggage_item(baggage_match[1], value)
    end
  end

  context
end