Sha256: f6d876b131f9470e062bf65a070810618842e3d372695a28b24c93345f8b768a
Contents?: true
Size: 789 Bytes
Versions: 31
Compression:
Stored size: 789 Bytes
Contents
module Appsignal module Rack class Listener def initialize(app, options = {}) Appsignal.logger.debug 'Initializing Appsignal::Rack::Listener' @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 Appsignal.set_exception(exception) raise exception ensure Appsignal::Transaction.complete_current! end def request_id(env) env['action_dispatch.request_id'] || SecureRandom.uuid end end end end
Version data entries
31 entries across 31 versions & 1 rubygems