Sha256: 2fcda07e83a824a6d95bb3275f280733dcbe6cb63ee92400ac2360a9fe4c7dcb

Contents?: true

Size: 811 Bytes

Versions: 10

Compression:

Stored size: 811 Bytes

Contents

# frozen_string_literal: true

require "honeycomb/propagation/honeycomb"
require "honeycomb/propagation/w3c"

module Honeycomb
  # Default behavior for handling trace propagation
  module DefaultPropagation
    # 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.
    module UnmarshalTraceContext
      def parse_rack_env(env)
        if env["HTTP_X_HONEYCOMB_TRACE"]
          HoneycombPropagation::UnmarshalTraceContext.parse_rack_env env
        elsif env["HTTP_TRACEPARENT"]
          W3CPropagation::UnmarshalTraceContext.parse_rack_env env
        else
          [nil, nil, nil, nil]
        end
      end
      module_function :parse_rack_env
      public :parse_rack_env
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
honeycomb-beeline-3.1.0 lib/honeycomb/propagation/default.rb
honeycomb-beeline-3.0.1 lib/honeycomb/propagation/default.rb
honeycomb-beeline-3.0.0 lib/honeycomb/propagation/default.rb
honeycomb-beeline-2.11.1.pre.dev lib/honeycomb/propagation/default.rb
honeycomb-beeline-2.11.0 lib/honeycomb/propagation/default.rb
honeycomb-beeline-2.10.0 lib/honeycomb/propagation/default.rb
honeycomb-beeline-2.9.0 lib/honeycomb/propagation/default.rb
honeycomb-beeline-2.8.2 lib/honeycomb/propagation/default.rb
honeycomb-beeline-2.8.1 lib/honeycomb/propagation/default.rb
honeycomb-beeline-2.8.0 lib/honeycomb/propagation/default.rb