Sha256: be2eedbaa4b8e831e3e94fe44b76696fbaeb202f3507e6a44028eacf96e35e03

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'instrumentation'

module NewRelic::Agent::Instrumentation
  module AwsSdkLambda::Chain
    def self.instrument!
      ::Aws::Lambda::Client.class_eval do
        include NewRelic::Agent::Instrumentation::AwsSdkLambda

        alias_method(:invoke_without_new_relic, :invoke)

        def invoke(*args)
          invoke_with_new_relic(*args) { invoke_without_new_relic(*args) }
        end

        alias_method(:invoke_async_without_new_relic, :invoke_async)

        def invoke_async(*args)
          invoke_async_with_new_relic(*args) { invoke_async_without_new_relic(*args) }
        end

        alias_method(:invoke_with_response_stream_without_new_relic, :invoke_with_response_stream)

        def invoke_with_response_stream(*args)
          invoke_with_response_stream_with_new_relic(*args) { invoke_with_response_stream_without_new_relic(*args) }
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
newrelic_rpm-9.16.0 lib/new_relic/agent/instrumentation/aws_sdk_lambda/chain.rb