Class: OneApm::Rack::MiddlewareBase
- Inherits:
-
Object
- Object
- OneApm::Rack::MiddlewareBase
- Includes:
- MiddlewareHelper, MiddlewareTracing
- Defined in:
- lib/one_apm/rack/middleware_base.rb
Direct Known Subclasses
Constant Summary
Constants included from MiddlewareTracing
OneApm::Rack::MiddlewareTracing::OA_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, options = {}) ⇒ MiddlewareBase
constructor
A new instance of MiddlewareBase.
- #middleware_ignore? ⇒ Boolean
Methods included from MiddlewareHelper
#close_old_response, #gather_source
Methods included from MiddlewareTracing
#_oa_has_middleware_tracing, #build_transaction_options, #call, #capture_http_response_code, #events, #merge_first_middleware_options, #note_transaction_started
Constructor Details
#initialize(app, options = {}) ⇒ MiddlewareBase
Returns a new instance of MiddlewareBase.
14 15 16 17 18 19 20 21 |
# File 'lib/one_apm/rack/middleware_base.rb', line 14 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.
12 13 14 |
# File 'lib/one_apm/rack/middleware_base.rb', line 12 def category @category end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
12 13 14 |
# File 'lib/one_apm/rack/middleware_base.rb', line 12 def target @target end |
#transaction_options ⇒ Object (readonly)
Returns the value of attribute transaction_options.
12 13 14 |
# File 'lib/one_apm/rack/middleware_base.rb', line 12 def @transaction_options end |
Instance Method Details
#build_transaction_name ⇒ Object
23 24 25 26 |
# File 'lib/one_apm/rack/middleware_base.rb', line 23 def build_transaction_name prefix = OneApm::TransactionNamer.prefix_for_category(nil, @category) "#{prefix}#{self.class.name}/call" end |