Module: Honeycomb::DefaultModernPropagation::UnmarshalTraceContext

Defined in:
lib/honeycomb/propagation/default_modern.rb

Overview

Parse incoming trace headers.

Checks for and parses Honeycomb’s trace header or, if not found, then checks for and parses W3C trace parent header.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.parse_rack_env(env) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/honeycomb/propagation/default_modern.rb', line 14

def parse_rack_env(env)
  if env["HTTP_X_HONEYCOMB_TRACE"]
    HoneycombModernPropagation::UnmarshalTraceContext.parse_rack_env env
  elsif env["HTTP_TRACEPARENT"]
    W3CPropagation::UnmarshalTraceContext.parse_rack_env env
  else
    [nil, nil, nil, nil]
  end
end

Instance Method Details

#parse_rack_env(env) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/honeycomb/propagation/default_modern.rb', line 14

def parse_rack_env(env)
  if env["HTTP_X_HONEYCOMB_TRACE"]
    HoneycombModernPropagation::UnmarshalTraceContext.parse_rack_env env
  elsif env["HTTP_TRACEPARENT"]
    W3CPropagation::UnmarshalTraceContext.parse_rack_env env
  else
    [nil, nil, nil, nil]
  end
end