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
26
27
28
29
# File 'lib/infinite_tracing/channel.rb', line 22

def credentials
  if Config.local?
    :this_channel_is_insecure
  else
    # Uses system configured certificates by default
    GRPC::Core::ChannelCredentials.new
  end
end

#host_and_portObject



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

def host_and_port
  Config.trace_observer_host_and_port
end

#settingsObject



35
36
37
38
39
40
# File 'lib/infinite_tracing/channel.rb', line 35

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