Class: Appsignal::Rack::InstrumentationMiddleware
- Inherits:
-
AbstractMiddleware
- Object
- AbstractMiddleware
- Appsignal::Rack::InstrumentationMiddleware
- Defined in:
- lib/appsignal/rack/instrumentation_middleware.rb
Overview
Rack instrumentation middleware.
This Ruby gem automatically instruments several Rack based libraries, like Rails and Sinatra. This middleware does not need to be added manually to these frameworks.
This instrumentation middleware will wrap an app and report how long the request and response took, report errors that occurred in the app, and report metadata about the request method and path.
The action name for the endpoint is not set by default, which is required for performance monitoring. Set the action name in each endpoint using the Helpers::Instrumentation#set_action helper.
If multiple of these middlewares, or AbstractMiddleware subclasses are present in an app, only the top middleware will report errors from apps and other middleware.
This middleware is best used in combination with the EventHandler.
Constant Summary
Constants inherited from AbstractMiddleware
AbstractMiddleware::DEFAULT_ERROR_REPORTING
Instance Method Summary collapse
-
#initialize(app, options = {}) ⇒ InstrumentationMiddleware
constructor
A new instance of InstrumentationMiddleware.
Methods inherited from AbstractMiddleware
Constructor Details
#initialize(app, options = {}) ⇒ InstrumentationMiddleware
Returns a new instance of InstrumentationMiddleware.
56 57 58 59 |
# File 'lib/appsignal/rack/instrumentation_middleware.rb', line 56 def initialize(app, = {}) [:instrument_event_name] ||= "process_request_middleware.rack" super end |