Sha256: e1c2b3c1112e7ea25acbedfc63466a5b5dcca795aa2b9f30d22c551b2cbd371f

Contents?: true

Size: 1.59 KB

Versions: 7

Compression:

Stored size: 1.59 KB

Contents

# 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

require 'new_relic/agent/memory_logger'
require 'new_relic/agent/agent_logger'

module NewRelic
  class Control
    module PrivateInstanceMethods
      private

      def configure_high_security
        if security_settings_valid? && Agent.config[:high_security]
          Agent.logger.info('Installing high security configuration based on local configuration')
          Agent.config.replace_or_add_config(Agent::Configuration::HighSecuritySource.new(Agent.config))
        end
      end

      def log_yaml_source_failures(yaml_source)
        yaml_source.failures.each { |msg| stdout.puts Agent::AgentLogger.format_fatal_error(msg) }
      end

      def config_file_path
        @config_file_override || Agent.config[:config_path]
      end

      def create_logger(options)
        if ::NewRelic::Agent.logger.is_startup_logger?
          ::NewRelic::Agent.logger = NewRelic::Agent::AgentLogger.new(root, options.delete(:log))
        end
      end

      def init_instrumentation
        if !security_settings_valid?
          handle_invalid_security_settings
        elsif Agent.config[:agent_enabled] && !NewRelic::Agent.instance.started?
          start_agent
          install_instrumentation
        elsif !Agent.config[:agent_enabled]
          install_shim
        else
          DependencyDetection.detect!
        end
      end

      def init_security_agent
        SecurityInterface.instance.init_agent
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-9.17.0 lib/new_relic/control/private_instance_methods.rb
newrelic_rpm-9.16.1 lib/new_relic/control/private_instance_methods.rb
newrelic_rpm-9.16.0 lib/new_relic/control/private_instance_methods.rb
newrelic_rpm-9.15.0 lib/new_relic/control/private_instance_methods.rb
newrelic_rpm-9.14.0 lib/new_relic/control/private_instance_methods.rb
newrelic_rpm-9.13.0 lib/new_relic/control/private_instance_methods.rb
newrelic_rpm-9.12.0 lib/new_relic/control/private_instance_methods.rb