Class: TingYun::AgentMiddleware
- Inherits:
-
Object
- Object
- TingYun::AgentMiddleware
- Includes:
- Instrumentation::MiddlewareTracing
- Defined in:
- lib/ting_yun/middleware/agent_middleware.rb
Direct Known Subclasses
Constant Summary
Constants included from Instrumentation::MiddlewareTracing
Instrumentation::MiddlewareTracing::CONTENT_TYPE, Instrumentation::MiddlewareTracing::TXN_STARTED_KEY
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#transaction_options ⇒ Object
readonly
Returns the value of attribute transaction_options.
Instance Method Summary collapse
- #build_transaction_name ⇒ Object
-
#initialize(app) ⇒ AgentMiddleware
constructor
A new instance of AgentMiddleware.
Methods included from Instrumentation::MiddlewareTracing
#_nr_has_middleware_tracing, #build_transaction_options, #call, #capture_http_response_code, #capture_response_content_type, #events, #merge_first_middleware_options, #note_transaction_started, #sinatra_static?
Constructor Details
#initialize(app) ⇒ AgentMiddleware
Returns a new instance of AgentMiddleware.
11 12 13 14 15 16 17 18 |
# File 'lib/ting_yun/middleware/agent_middleware.rb', line 11 def initialize(app) @app = app @category = :middleware @target = self @transaction_options = { :transaction_name => build_transaction_name } end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
9 10 11 |
# File 'lib/ting_yun/middleware/agent_middleware.rb', line 9 def category @category end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
9 10 11 |
# File 'lib/ting_yun/middleware/agent_middleware.rb', line 9 def target @target end |
#transaction_options ⇒ Object (readonly)
Returns the value of attribute transaction_options.
9 10 11 |
# File 'lib/ting_yun/middleware/agent_middleware.rb', line 9 def @transaction_options end |
Instance Method Details
#build_transaction_name ⇒ Object
20 21 22 23 |
# File 'lib/ting_yun/middleware/agent_middleware.rb', line 20 def build_transaction_name prefix = ::TingYun::Instrumentation::Support::TransactionNamer.prefix_for_category(nil, @category) "#{prefix}#{self.class.name}/call" end |