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



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

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

#credentialsObject



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

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

#host_and_portObject



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

def host_and_port
  Config.trace_observer_host_and_port
end

#settingsObject



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

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

#stubObject



9
10
11
12
13
14
15
16
17
# 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