Sha256: e8ae14ef94bfaa27757f40e82e74ef0d3907a6ef5cca07f4ad9bc6a5156fea4a
Contents?: true
Size: 810 Bytes
Versions: 37
Compression:
Stored size: 810 Bytes
Contents
module Appsignal module Rack class Listener def initialize(app, options = {}) @app, @options = app, options end def call(env) if Appsignal.active? call_with_appsignal_monitoring(env) else @app.call(env) end end def call_with_appsignal_monitoring(env) Appsignal::Transaction.create(request_id(env), env) @app.call(env) rescue Exception => exception unless Appsignal.is_ignored_exception?(exception) Appsignal::Transaction.current.add_exception(exception) end raise exception ensure Appsignal::Transaction.current.complete! end def request_id(env) env['action_dispatch.request_id'] || SecureRandom.uuid end end end end
Version data entries
37 entries across 37 versions & 1 rubygems