Sha256: 0a3d4f6e8904ab9bb1f0476dee78715ae7ed1808b813664a4a282a0004e2abda

Contents?: true

Size: 754 Bytes

Versions: 6

Compression:

Stored size: 754 Bytes

Contents

# frozen_string_literal: true

# Copyright 2020 OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Instrumentation
    module ConcurrentRuby
      # The Instrumentation class contains logic to detect and install the
      # ConcurrentRuby instrumentation
      class Instrumentation < OpenTelemetry::Instrumentation::Base
        install do |_config|
          require_dependencies
          patch
        end

        present do
          defined?(::Concurrent::Future)
        end

        private

        def require_dependencies
          require_relative 'patches/future'
        end

        def patch
          ::Concurrent::Future.send(:include, Patches::Future)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-concurrent_ruby-0.10.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.9.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.8.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.7.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.6.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.5.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb