Sha256: 10313336c1db4a5f742af8f1c6abd9878d7a6f828d637eb77f225bf7210f9021

Contents?: true

Size: 1.27 KB

Versions: 13

Compression:

Stored size: 1.27 KB

Contents

#--
# Copyright (c) 2016 SolarWinds, LLC.
# All rights reserved.
#++

module AppOpticsAPM
  module API
    ##
    # Provides methods related to layer initialization and reporting
    module LayerInit #:nodoc:
      # Internal: Report that instrumentation for the given layer has been
      # installed, as well as the version of instrumentation and version of
      # layer.
      #
      def report_init(layer = :rack) #:nodoc:
        # Don't send __Init in test or if AppOpticsAPM
        # isn't fully loaded (e.g. missing c-extension)
        return if ENV.key?('APPOPTICS_GEM_TEST') || !AppOpticsAPM.loaded

        platform_info = AppOpticsAPM::Util.build_init_report
        log_init(layer, platform_info)
      end

      ##
      # :nodoc:
      # Deprecated:
      # force_trace has been deprecated and will be removed in a subsequent version.
      #
      def force_trace
        AppOpticsAPM.logger.warn '[appoptics_apm/api] AppOpticsAPM::API::LayerInit.force_trace has been deprecated and will be ' \
                         'removed in a subsequent version.'

        saved_mode = AppOpticsAPM::Config[:tracing_mode]
        AppOpticsAPM::Config[:tracing_mode] = :always
        yield
      ensure
        AppOpticsAPM::Config[:tracing_mode] = saved_mode
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
appoptics_apm_mnfst-4.5.2 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.5.2 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.5.1 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.5.0 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.4.1 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.4.0 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.3.1 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.3.0 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.2.7 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.2.6 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.2.5 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.2.4 lib/appoptics_apm/api/layerinit.rb
appoptics_apm-4.2.3 lib/appoptics_apm/api/layerinit.rb