Class: Aws::Xray::Rack
- Inherits:
-
Object
- Object
- Aws::Xray::Rack
- Defined in:
- lib/aws/xray/rack.rb
Constant Summary collapse
- TRACE_ENV =
'HTTP_X_AMZN_TRACE_ID'.freeze
- ORIGINAL_TRACE_ENV =
'HTTP_X_AMZN_TRACE_ID_ORIGINAL'.freeze
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, excluded_paths: []) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app, excluded_paths: []) ⇒ Rack
Returns a new instance of Rack.
8 9 10 11 12 |
# File 'lib/aws/xray/rack.rb', line 8 def initialize(app, excluded_paths: []) @app = app @name = Aws::Xray.config.name || raise(MissingNameError) @excluded_paths = excluded_paths + Aws::Xray.config.excluded_paths end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/aws/xray/rack.rb', line 14 def call(env) if excluded_path?(env['PATH_INFO']) @app.call(env) else call_with_tracing(env) end end |