Sha256: a563edd475428e57590fb455196b79d558753984a1de701b7fc3ad93d068a5c0

Contents?: true

Size: 684 Bytes

Versions: 3

Compression:

Stored size: 684 Bytes

Contents

require 'ddtrace/contrib/patcher'
require 'ddtrace/ext/app_types'

require 'ddtrace/contrib/grape/ext'
require 'ddtrace/contrib/grape/endpoint'
require 'ddtrace/contrib/grape/instrumentation'

module Datadog
  module Contrib
    module Grape
      # Patcher enables patching of 'grape' module.
      module Patcher
        include Contrib::Patcher

        module_function

        def target_version
          Integration.version
        end

        def patch
          # Patch endpoints
          ::Grape::Endpoint.include(Instrumentation)

          # Subscribe to ActiveSupport events
          Datadog::Contrib::Grape::Endpoint.subscribe
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ddtrace-0.51.1 lib/ddtrace/contrib/grape/patcher.rb
ddtrace-0.51.0 lib/ddtrace/contrib/grape/patcher.rb
ddtrace-0.50.0 lib/ddtrace/contrib/grape/patcher.rb