Class: NewRelic::Agent::InfiniteTracing::Channel
- Inherits:
-
Object
- Object
- NewRelic::Agent::InfiniteTracing::Channel
- Defined in:
- lib/infinite_tracing/channel.rb
Constant Summary collapse
- SETTINGS_BASE =
{'grpc.enable_deadline_checking' => 0}.freeze
- SETTINGS_COMPRESSION_DISABLED =
SETTINGS_BASE.merge({'grpc.minimal_stack' => 1}).freeze
Instance Method Summary collapse
- #channel ⇒ Object
- #channel_args ⇒ Object
- #credentials ⇒ Object
- #host_and_port ⇒ Object
- #settings ⇒ Object
- #stub ⇒ Object
Instance Method Details
#channel ⇒ Object
30 31 32 |
# File 'lib/infinite_tracing/channel.rb', line 30 def channel GRPC::Core::Channel.new(host_and_port, settings, credentials) end |
#channel_args ⇒ Object
40 41 42 43 44 45 |
# File 'lib/infinite_tracing/channel.rb', line 40 def channel_args return NewRelic::EMPTY_HASH unless Config.compression_enabled? GRPC::Core::CompressionOptions.new(default_algorithm: :gzip, default_level: Config.compression_level).to_channel_arg_hash end |
#credentials ⇒ Object
26 27 28 |
# File 'lib/infinite_tracing/channel.rb', line 26 def credentials @credentials ||= GRPC::Core::ChannelCredentials.new end |
#host_and_port ⇒ Object
22 23 24 |
# File 'lib/infinite_tracing/channel.rb', line 22 def host_and_port Config.trace_observer_host_and_port end |
#settings ⇒ Object
34 35 36 37 38 |
# File 'lib/infinite_tracing/channel.rb', line 34 def settings return channel_args.merge(SETTINGS_COMPRESSION_DISABLED).freeze unless Config.compression_enabled? channel_args.merge(SETTINGS_BASE).freeze end |
#stub ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/infinite_tracing/channel.rb', line 11 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, channel_args: channel_args ) end |