Class: NewRelic::Agent::Instrumentation::Grape
- Inherits:
-
Grape::Middleware::Base
- Object
- Grape::Middleware::Base
- NewRelic::Agent::Instrumentation::Grape
- Includes:
- ControllerInstrumentation
- Defined in:
- lib/newrelic-grape/instrument.rb
Instance Method Summary collapse
Instance Method Details
#call!(env) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/newrelic-grape/instrument.rb', line 10 def call!(env) @env = env @newrelic_request = ::Rack::Request.new(env) = { :category => :rack, :path => "#{request_method} #{request_path}", :request => @newrelic_request, :params => @newrelic_request.params } perform_action_with_newrelic_trace() do @app_response = @app.call(@env) end end |
#request_method ⇒ Object
28 29 30 |
# File 'lib/newrelic-grape/instrument.rb', line 28 def request_method @newrelic_request.request_method end |
#request_path ⇒ Object
24 25 26 |
# File 'lib/newrelic-grape/instrument.rb', line 24 def request_path env['api.endpoint'].routes.first.route_path[1..-1].gsub("/", "-").sub(/\(\.:format\)\z/, "") end |