Class: Rack::Instrumentation::Tracer
- Inherits:
-
Object
- Object
- Rack::Instrumentation::Tracer
- Defined in:
- lib/rack/instrumentation/tracer.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#tracer ⇒ Object
readonly
Returns the value of attribute tracer.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, tracer: OpenTracing.global_tracer) ⇒ Tracer
constructor
Create a new Rack Tracer middleware.
Constructor Details
#initialize(app, tracer: OpenTracing.global_tracer) ⇒ Tracer
Create a new Rack Tracer middleware.
14 15 16 17 |
# File 'lib/rack/instrumentation/tracer.rb', line 14 def initialize(app, tracer: OpenTracing.global_tracer) @app = app @tracer = tracer end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
7 8 9 |
# File 'lib/rack/instrumentation/tracer.rb', line 7 def app @app end |
#tracer ⇒ Object (readonly)
Returns the value of attribute tracer.
7 8 9 |
# File 'lib/rack/instrumentation/tracer.rb', line 7 def tracer @tracer end |
Instance Method Details
#call(env) ⇒ Object
19 20 21 22 23 |
# File 'lib/rack/instrumentation/tracer.rb', line 19 def call(env) tracer.start_active_span(*span_args(env)) do |scope| trace_request(env, scope) end end |