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, client_options: {}, excluded_paths: []) ⇒ Rack
constructor
A new instance of Rack.
Constructor Details
#initialize(app, client_options: {}, excluded_paths: []) ⇒ Rack
Returns a new instance of Rack.
16 17 18 19 20 21 |
# File 'lib/aws/xray/rack.rb', line 16 def initialize(app, client_options: {}, excluded_paths: []) @app = app @name = Aws::Xray.config.name || raise(MissingNameError) @client = Client.new(Aws::Xray.config..merge()) @excluded_paths = excluded_paths + Aws::Xray.config.excluded_paths end |
Instance Method Details
#call(env) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/aws/xray/rack.rb', line 23 def call(env) if excluded_path?(env['PATH_INFO']) @app.call(env) else call_with_tracing(env) end end |