Module: Datadog::Contrib::GRPC::InterceptWithDatadog

Defined in:
lib/ddtrace/contrib/grpc/intercept_with_datadog.rb

Overview

:nodoc: The ‘#intercept!` method is implemented in gRPC; this module will be prepended to the original class, effectively injecting our tracing middleware into the head of the call chain.

Instance Method Summary collapse

Instance Method Details

#intercept!(type, args = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ddtrace/contrib/grpc/intercept_with_datadog.rb', line 11

def intercept!(type, args = {})
  if should_prepend?
    datadog_interceptor = choose_datadog_interceptor(args)

    @interceptors.unshift(datadog_interceptor.new) if datadog_interceptor

    @trace_started = true
  end

  super
end