Class: ILove::Tracing::IncomingRequests::TraceRackMiddleware
- Inherits:
-
Object
- Object
- ILove::Tracing::IncomingRequests::TraceRackMiddleware
- Defined in:
- lib/ilove/tracing/incoming_requests.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ TraceRackMiddleware
constructor
A new instance of TraceRackMiddleware.
Constructor Details
#initialize(app) ⇒ TraceRackMiddleware
Returns a new instance of TraceRackMiddleware.
5 6 7 |
# File 'lib/ilove/tracing/incoming_requests.rb', line 5 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/ilove/tracing/incoming_requests.rb', line 9 def call(env) extracted_ctx = OpenTracing.global_tracer.extract(OpenTracing::FORMAT_RACK, env) span = OpenTracing.start_span('incoming http request', child_of: extracted_ctx) scope = OpenTracing.scope_manager.activate span @app.call(env) ensure scope.close end |