Sha256: 8521c76991b44aa940579e017b8aab6d7ab8be98f944e27cb36a85fd00863561

Contents?: true

Size: 1.07 KB

Versions: 11

Compression:

Stored size: 1.07 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

module NewRelic::Agent
  module InfiniteTracing
    class Channel

      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

      def channel
        GRPC::Core::Channel.new(host_and_port, settings, credentials)
      end
      
      def credentials
        if Config.local?
          :this_channel_is_insecure 
        else
          # Uses system configured certificates by default
          GRPC::Core::ChannelCredentials.new
        end
      end

      def host_and_port
        Config.trace_observer_host_and_port
      end

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

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
newrelic-infinite_tracing-8.2.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-8.1.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-8.0.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-7.2.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-7.1.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-7.0.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-6.15.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-6.14.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-6.13.1 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-6.13.0 lib/infinite_tracing/channel.rb
newrelic-infinite_tracing-6.12.0.367 lib/infinite_tracing/channel.rb