Sha256: be30117fc3e0da32d2fd8c23c6eab728a8054a1bef53cb9e50b424461cdfe373
Contents?: true
Size: 1.46 KB
Versions: 38
Compression:
Stored size: 1.46 KB
Contents
# encoding: utf-8 require 'one_apm/support/library_detection' module OneApm class Probe module Instrumentation def install_instrumentation return if @instrumented @instrumented = true instrumentation_path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'inst')) Dir.glob("#{instrumentation_path}/**/*.rb").each do |inst_file| load_instrumentation_files inst_file end detect_dependencies OneApm::Manager.logger.info "Finished instrumentation" end def load_instrumentation_files pattern Dir.glob(pattern) { |file| require_instrumentation(file.to_s) } end def detect_dependencies LibraryDetection.detect! end def require_instrumentation file require file rescue => e OneApm::Manager.logger.warn "Error loading instrumentation file '#{file}':", e end def install_shim if @instrumented OneApm::Manager.logger.error "Cannot install the Agent shim after instrumentation has already been installed!" OneApm::Manager.logger.error caller.join("\n") else OneApm::Manager.agent = OneApm::Agent::ShimAgent.instance end end def add_instrumentation pattern if @instrumented load_instrumentation_files pattern else @instrumentation_files << pattern end end end include Instrumentation end end
Version data entries
38 entries across 38 versions & 1 rubygems