Class: Gruf::Newrelic::ServerInterceptor

Inherits:
Interceptors::ServerInterceptor
  • Object
show all
Includes:
NewRelic::Agent::Instrumentation::ControllerInstrumentation
Defined in:
lib/gruf/newrelic/server_interceptor.rb

Overview

New Relic transaction tracing for Gruf endpoints

Instance Method Summary collapse

Instance Method Details

#callObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/gruf/newrelic/server_interceptor.rb', line 28

def call
  opts = {
    category: Gruf::Newrelic.server_category,
    class_name: request.service,
    name: request.method_key
  }

  # Yield to the given block with NewRelic tracing.
  # http://www.rubydoc.info/github/newrelic/rpm/NewRelic%2FAgent%2FInstrumentation%2FControllerInstrumentation:perform_action_with_newrelic_trace
  perform_action_with_newrelic_trace(opts) do
    accept_distributed_tracing
    yield
  end
end