Sha256: 1f985cdf9af72f80c3cdbea364209043f4bdf063895129245f95fc8d0ef2bac2

Contents?: true

Size: 784 Bytes

Versions: 2

Compression:

Stored size: 784 Bytes

Contents

# typed: true

require 'datadog/tracing/contrib/grape/endpoint'
require 'datadog/tracing/contrib/grape/ext'
require 'datadog/tracing/contrib/grape/instrumentation'
require 'datadog/tracing/contrib/grape/integration'
require 'datadog/tracing/contrib/patcher'

module Datadog
  module Tracing
    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
            Endpoint.subscribe
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ddtrace-1.0.0 lib/datadog/tracing/contrib/grape/patcher.rb
ddtrace-1.0.0.beta2 lib/datadog/tracing/contrib/grape/patcher.rb