Class: NewRelic::Rack::AgentMiddleware

Inherits:
Object
  • Object
show all
Includes:
Agent::Instrumentation::MiddlewareTracing
Defined in:
lib/new_relic/rack/agent_middleware.rb

Direct Known Subclasses

AgentHooks, BrowserMonitoring

Constant Summary

Constants included from Agent::Instrumentation::MiddlewareTracing

Agent::Instrumentation::MiddlewareTracing::CONTENT_LENGTH, Agent::Instrumentation::MiddlewareTracing::CONTENT_TYPE, Agent::Instrumentation::MiddlewareTracing::TXN_STARTED_KEY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Agent::Instrumentation::MiddlewareTracing

#_nr_has_middleware_tracing, #build_transaction_options, #call, #capture_http_response_code, #capture_response_attributes, #capture_response_content_length, #capture_response_content_type, #events, #merge_first_middleware_options, #note_transaction_started

Constructor Details

#initialize(app, options = {}) ⇒ AgentMiddleware

Returns a new instance of AgentMiddleware.



16
17
18
19
20
21
22
23
# File 'lib/new_relic/rack/agent_middleware.rb', line 16

def initialize(app, options = {})
  @app = app
  @category = :middleware
  @target = self
  @transaction_options = {
    :transaction_name => build_transaction_name
  }
end

Instance Attribute Details

#categoryObject (readonly)



14
15
16
# File 'lib/new_relic/rack/agent_middleware.rb', line 14

def category
  @category
end

#targetObject (readonly)



14
15
16
# File 'lib/new_relic/rack/agent_middleware.rb', line 14

def target
  @target
end

#transaction_optionsObject (readonly)



14
15
16
# File 'lib/new_relic/rack/agent_middleware.rb', line 14

def transaction_options
  @transaction_options
end

Instance Method Details

#build_transaction_nameObject



25
26
27
28
# File 'lib/new_relic/rack/agent_middleware.rb', line 25

def build_transaction_name
  prefix = ::NewRelic::Agent::Instrumentation::ControllerInstrumentation::TransactionNamer.prefix_for_category(nil, @category)
  "#{prefix}#{self.class.name}/call"
end