Sha256: 7e833e05f090e6956d5a648f17f38038acd59db2d2ee4a893bc7a33e5eb4f865

Contents?: true

Size: 362 Bytes

Versions: 3

Compression:

Stored size: 362 Bytes

Contents

require_relative 'base'

module RequestTracer
  module Integration
    class RackHandler
      include Base
      def initialize(app, config={})
        @app = app
        @tracer = config[:tracer] || Trace
      end
      def call(env)
        @tracer.record(extract_fields_from_headers(env)) do
          @app.call(env)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
request-tracer-0.5.4 lib/request_tracer/integration/rack_handler.rb
request-tracer-0.5.3 lib/request_tracer/integration/rack_handler.rb
request-tracer-0.5.2 lib/request_tracer/integration/rack_handler.rb