You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order for the requests to show up correctly, I need to pass in the class_name of the controller / service. It seems like the @service is a natural fit for this use case.
Herre is an example of the code I wrote which can instrument Gruf endpoints using newrelic, (maybe this is something which can also be brought into Gruf).
require'new_relic/agent'moduleInterceptorsmoduleGruf### New Relic transaction tracing for Gruf endpoints#classNewRelicTracer < ::Gruf::Interceptors::ServerInterceptorinclude ::NewRelic::Agent::Instrumentation::ControllerInstrumentationdefcallopts={category: :controller,class_name: request.instance_variable_get('@service'),name: request.method_key}perform_action_with_newrelic_trace(opts)doyieldendendendendend
I would also gladly open a pr to add an attr_reader for the service but figure we may want to have a different approach to expose these values.
The text was updated successfully, but these errors were encountered:
pedelman
changed the title
Expose @service from Gruf::Controller::Request to interceptors
Expose @service from Gruf::Controllers::Request to interceptors
Dec 14, 2017
Also @Parad0X this is pretty similar to the exposing of the rpc_desc, perhaps the approach can be similar, I know @splittingred has some ideas on how we want to expose these attributes to interceptors.
I would like to instrument Gruf endpoints with New Relic. For this I plan to create an interceptor which will utilize the
ControllerInstrumentation#perform_action_with_newrelic_trace
. http://www.rubydoc.info/github/newrelic/rpm/NewRelic%2FAgent%2FInstrumentation%2FControllerInstrumentation:perform_action_with_newrelic_traceIn order for the requests to show up correctly, I need to pass in the
class_name
of the controller / service. It seems like the@service
is a natural fit for this use case.https://github.com/bigcommerce/gruf/blob/master/lib/gruf/controllers/request.rb#L54
Herre is an example of the code I wrote which can instrument Gruf endpoints using newrelic, (maybe this is something which can also be brought into Gruf).
I would also gladly open a pr to add an attr_reader for the service but figure we may want to have a different approach to expose these values.
The text was updated successfully, but these errors were encountered: