Class: TingYun::AgentMiddleware

Inherits:
Object
  • Object
show all
Includes:
Instrumentation::MiddlewareTracing
Defined in:
lib/ting_yun/middleware/agent_middleware.rb

Direct Known Subclasses

BrowserMonitoring

Constant Summary

Constants included from Instrumentation::MiddlewareTracing

Instrumentation::MiddlewareTracing::CONTENT_TYPE, Instrumentation::MiddlewareTracing::TXN_STARTED_KEY

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#categoryObject (readonly)

Returns the value of attribute category.



9
10
11
# File 'lib/ting_yun/middleware/agent_middleware.rb', line 9

def category
  @category
end

#targetObject (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_optionsObject (readonly)

Returns the value of attribute transaction_options.



9
10
11
# File 'lib/ting_yun/middleware/agent_middleware.rb', line 9

def transaction_options
  @transaction_options
end

Instance Method Details

#build_transaction_nameObject



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