performance - New relic custom instrumentation for Grape::Middleware::Formatter#call method in Rails app -



performance - New relic custom instrumentation for Grape::Middleware::Formatter#call method in Rails app -

in rails app's new relic transaction section, can see particular method phone call (grape::middleware::formatter#call) time consuming 1 (taking 90% of time):

middleware grape::middleware::formatter#call 89.2 % (time) 824 ms (avg time)

but there not plenty info provided causing performance issue in new relic's transaction breakdown table. want add together ruby custom instrumentation method new relic can provide me more info problem showing events happening when grape::middleware::formatter#call method called.

looking @ new relic's documentation adding custom instrumentation have created new file name config/initializers/rpm_instrumentation.rb , next content:

require 'new_relic/agent/method_tracer' grape::middleware::formatter.class_eval include ::newrelic::agent::methodtracer add_method_tracer :call end

but in development mode, new relic not show info under call: grape::middleware::formatter/call. summary, sql calls shown there before adding custom tracer means custom tracer not working expected.

so question missing here? new relic back upwards type of method instrumentation not direct part of rails app coming gems beingness used rails app? (in case, grape::middleware::formatter#call method part of 'grape' gem).

new relic not back upwards grape @ time. you're seeing default time entire grape transaction, starting in middleware , ending @ grape endpoint. however, ruby agent lists entire time under 1 transaction name right (the grape::middleware::formatter#call you're seeing). break apart grape transaction various endpoints, should utilize set_transaction_name provide unique name transaction each endpoint.

to more details on methods within call, you'll need utilize add_method_tracer, not adding method tracer call itself, rather using add_method_tracer on other methods within call. you'll want set in initializer or other setup phase of application, before transactions happen, while set_transaction_name called during transaction (e.g. in controller).

ruby-on-rails performance newrelic newrelic-platform

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -