Class: NewRelic::Agent::InfiniteTracing::Channel

Inherits:
Object
  • Object
show all
Defined in:
lib/infinite_tracing/channel.rb

Instance Method Summary collapse

Instance Method Details

#channelObject



18
19
20
# File 'lib/infinite_tracing/channel.rb', line 18

def channel
  GRPC::Core::Channel.new(host_and_port, settings, credentials)
end

#credentialsObject



22
23
24
25
# File 'lib/infinite_tracing/channel.rb', line 22

def credentials
  # Uses system configured certificates by default
  GRPC::Core::ChannelCredentials.new
end

#host_and_portObject



27
28
29
# File 'lib/infinite_tracing/channel.rb', line 27

def host_and_port
  Config.trace_observer_host_and_port
end

#settingsObject



31
32
33
34
35
36
# File 'lib/infinite_tracing/channel.rb', line 31

def settings
  {
    'grpc.minimal_stack' => 1,
    'grpc.enable_deadline_checking' => 0
  }
end

#stubObject



9
10
11
12
13
14
15
16
# File 'lib/infinite_tracing/channel.rb', line 9

def stub
  NewRelic::Agent.logger.debug "Infinite Tracer Opening Channel to #{host_and_port}"

  Com::Newrelic::Trace::V1::IngestService::Stub.new \
    host_and_port,
    credentials,
    channel_override: channel
end