Module: Datadog::Contrib::Aws::Patcher

Defined in:
lib/ddtrace/contrib/aws/patcher.rb

Overview

Responsible for hooking the instrumentation into aws-sdk

Class Method Summary collapse

Class Method Details

.patchObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ddtrace/contrib/aws/patcher.rb', line 13

def patch
  return @patched if patched? || !defined?(Seahorse::Client::Base)

  require 'ddtrace/ext/app_types'
  require 'ddtrace/contrib/aws/parsed_context'
  require 'ddtrace/contrib/aws/instrumentation'
  require 'ddtrace/contrib/aws/services'

  add_pin
  add_plugin(Seahorse::Client::Base, *loaded_constants)

  @patched = true
rescue => e
  Datadog::Tracer.log.error("Unable to apply AWS integration: #{e}")
  @patched
end

.patched?Boolean

Returns:



30
31
32
# File 'lib/ddtrace/contrib/aws/patcher.rb', line 30

def patched?
  @patched
end