Sha256: dbe21dcc9f11dc1835f0fd43d0ac9cbd91416f5cc0c7de5cccbf5da4abf17860
Contents?: true
Size: 1.2 KB
Versions: 25
Compression:
Stored size: 1.2 KB
Contents
# (c) Copyright IBM Corp. 2021 # (c) Copyright Instana Inc. 2021 module Instana class Activator class << self attr_reader :trace_point, :activators def start # :nocov: @trace_point = TracePoint.new(:end) do activated = ::Instana::Activator.call ::Instana.logger.debug { "Activated #{activated.join(', ')}" } unless activated.empty? end @trace_point.enable if enabled? # :nocov: end def call @activators ||= [] activated, @activators = @activators.partition(&:call) activated end def inherited(subclass) super(subclass) @activators ||= [] @activators << subclass.new end private def enabled? ENV.fetch('INSTANA_DISABLE_AUTO_INSTR', 'false').eql?('false') || !ENV.key?('INSTANA_DISABLE') end end def call instrument if can_instrument? end end end Dir["#{__dir__}/activators/*.rb"] .sort .select do |f| # :nocov: if ENV['INSTANA_ACTIVATE_SET'] base = File.basename(f, '.rb') ENV.fetch('INSTANA_ACTIVATE_SET', '').split(',').include?(base) else true end # :nocov: end .each { |f| require(f) }
Version data entries
25 entries across 25 versions & 1 rubygems