Sha256: c876f92d1db92777ae82ebe791fd869009411f094ee4ae3cc408054ca9fccd92
Contents?: true
Size: 1.13 KB
Versions: 17
Compression:
Stored size: 1.13 KB
Contents
require 'ddtrace/ext/app_types' require 'ddtrace/contrib/rake/instrumentation' module Datadog module Contrib module Rake # Patcher for Rake instrumentation module Patcher include Base register_as :rake option :service_name, default: 'rake' option :tracer, default: Datadog.tracer option :enabled, default: true option :quantize, default: {} module_function def patch return patched? if patched? || !compatible? patch_rake # Set service info configuration[:tracer].set_service_info( configuration[:service_name], 'rake', Ext::AppTypes::WORKER ) @patched = true end def patched? return @patched if defined?(@patched) @patched = false end def patch_rake ::Rake::Task.send(:include, Instrumentation) end def compatible? RUBY_VERSION >= '2.0.0' && defined?(::Rake) end def configuration Datadog.configuration[:rake] end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems