Sha256: 677c73cc8a253a60a6b24f979c73763cffe0d1e1bc3b26e7c584f72d00780c1f
Contents?: true
Size: 789 Bytes
Versions: 53
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.add_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
53 entries across 53 versions & 1 rubygems