Sha256: a80c42119d3650e928879f483f04d9ab70940c181869f5dfb91eccb60f73d871

Contents?: true

Size: 753 Bytes

Versions: 10

Compression:

Stored size: 753 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::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

10 entries across 10 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-concurrent_ruby-0.18.2 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.18.1 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.18.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.17.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.16.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.15.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.14.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.13.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.12.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb
opentelemetry-instrumentation-concurrent_ruby-0.11.0 lib/opentelemetry/instrumentation/concurrent_ruby/instrumentation.rb