Module: XRay::Patcher

Included in:
Configuration
Defined in:
lib/aws-xray-sdk/patcher.rb

Overview

Patching external libraries/frameworks to be traced by X-Ray recorder.

Instance Method Summary collapse

Instance Method Details

#patch(targets) ⇒ Object

Parameters:

  • targets (Array)

    A list of libraries/frameworks to patch.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/aws-xray-sdk/patcher.rb', line 7

def patch(targets)
  targets.each do |l|
    case l
    when :net_http
      require 'aws-xray-sdk/facets/net_http'
    when :aws_sdk
      require 'aws-xray-sdk/facets/aws_sdk'
      XRay::AwsSDKPatcher.patch
    else
      raise UnsupportedPatchingTargetError.new(%(#{l} is not supported by X-Ray SDK.))
    end
  end
end