Class: AppsignalExtensions::Middleware
- Inherits:
-
Object
- Object
- AppsignalExtensions::Middleware
- Defined in:
- lib/appsignal_extensions/middleware.rb
Defined Under Namespace
Classes: Close, NullTransaction, TransactionClosingBody
Instance Method Summary collapse
-
#call(env) ⇒ Array
Calls the application, captures errors, sets up wrappers and so forth.
-
#initialize(app) ⇒ Middleware
constructor
Creates a new Appsignal middleware handler with the given Rack app as a callee.
Constructor Details
#initialize(app) ⇒ Middleware
Creates a new Appsignal middleware handler with the given Rack app as a callee
65 66 67 |
# File 'lib/appsignal_extensions/middleware.rb', line 65 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Array
Calls the application, captures errors, sets up wrappers and so forth
73 74 75 76 77 78 79 80 81 |
# File 'lib/appsignal_extensions/middleware.rb', line 73 def call(env) request = ::Rack::Request.new(env) env["action_dispatch.request_id"] ||= SecureRandom.uuid if Appsignal.active? call_with_appsignal(env, request) else call_with_null_transaction(env, request) end end |