Module: OpenTelemetry::Instrumentation::Grpc::Patches::ClientStub

Defined in:
lib/opentelemetry/instrumentation/grpc/patches/client_stub.rb

Overview

Module to be prepended to force gRPC to use the client interceptor by default so the user doesn’t have to manually add it when initializing a client.

Instance Method Summary collapse

Instance Method Details

#initialize(host, creds, **args) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/opentelemetry/instrumentation/grpc/patches/client_stub.rb', line 14

def initialize(host, creds, **args)
  interceptors = args[:interceptors] || []
  interceptors.unshift(Interceptors::ClientTracer.new) unless interceptors.any?(Interceptors::ClientTracer)
  args[:interceptors] = interceptors

  super
end