Sha256: a5549c180e4c32f01c465181914017b923a5c39b886857039a7c51729840df4c
Contents?: true
Size: 1.06 KB
Versions: 42
Compression:
Stored size: 1.06 KB
Contents
module OneApm module Agent module Instrumentation module Rack include TransactionBase def oneapm_request_headers(_) @oneapm_request.env end def call_with_oneapm(*args) @oneapm_request = ::Rack::Request.new(args.first) perform_action_with_oneapm_trace(:category => :middleware, :request => @oneapm_request) do result = call_without_oneapm(*args) # Ignore cascaded calls Transaction.abort_transaction! if result.first == 404 result end end def self.included middleware middleware.class_eval do alias call_without_oneapm call alias call call_with_oneapm end end def self.extended middleware middleware.class_eval do class << self alias call_without_oneapm call alias call call_with_oneapm end end end def _oa_has_middleware_tracing true end end end end end
Version data entries
42 entries across 42 versions & 1 rubygems