class NewRelic::Rack::AgentMiddleware
Attributes
category[R]
target[R]
transaction_options[R]
Public Class Methods
new(app, options={})
click to toggle source
# File lib/new_relic/rack/agent_middleware.rb, line 15 def initialize(app, options={}) @app = app @category = :middleware @target = self @transaction_options = { :transaction_name => build_transaction_name } end
Public Instance Methods
build_transaction_name()
click to toggle source
# File lib/new_relic/rack/agent_middleware.rb, line 24 def build_transaction_name prefix = ::NewRelic::Agent::Instrumentation::ControllerInstrumentation::TransactionNamer.prefix_for_category(nil, @category) "#{prefix}#{self.class.name}/call" end
capture_http_response_code(state, result)
click to toggle source
If middleware tracing is disabled, we'll still inject our agent-specific middlewares, and still trace those, but we don't want to capture HTTP response codes, since middleware that's outside of ours might change the response code before it goes back to the client.
Calls superclass method
NewRelic::Agent::Instrumentation::MiddlewareTracing#capture_http_response_code
# File lib/new_relic/rack/agent_middleware.rb, line 33 def capture_http_response_code(state, result) return if NewRelic::Agent.config[:disable_middleware_instrumentation] super end
capture_response_content_type(state, result)
click to toggle source
Calls superclass method
NewRelic::Agent::Instrumentation::MiddlewareTracing#capture_response_content_type
# File lib/new_relic/rack/agent_middleware.rb, line 38 def capture_response_content_type(state, result) return if NewRelic::Agent.config[:disable_middleware_instrumentation] super end