Sha256: 51d816180effabc4be88d237c208fffb9ea05c276c940d58f5c9100a0207fb5c

Contents?: true

Size: 795 Bytes

Versions: 11

Compression:

Stored size: 795 Bytes

Contents

# frozen_string_literal: true

# Copyright The 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::ThreadPoolExecutor)
        end

        private

        def require_dependencies
          require_relative 'patches/thread_pool_executor'
        end

        def patch
          ::Concurrent::ThreadPoolExecutor.prepend Patches::ThreadPoolExecutor
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-concurrent_ruby-0.21.4 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.21.3 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.21.2 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.21.1 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.21.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.20.1 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.20.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.19.3 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.19.2 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.19.1 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.19.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb