Sha256: 9eb8ce8cc20cce0bcff6c2aa36e612bc3c7ebf5bab8f44a309f2f02e48038bc7

Contents?: true

Size: 785 Bytes

Versions: 6

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true

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

require_relative '../context_composite_executor_service'

module OpenTelemetry
  module Instrumentation
    module ConcurrentRuby
      module Patches
        # Concurrent::Future patch for instrumentation
        module Future
          def self.included(base)
            base.class_eval do
              alias_method :ns_initialize_without_otel, :ns_initialize
              remove_method(:ns_initialize)

              def ns_initialize(value, opts)
                ns_initialize_without_otel(value, opts)

                @executor = ContextCompositeExecutorService.new(@executor)
              end
            end
          end
        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/patches/future.rb
opentelemetry-instrumentation-concurrent_ruby-0.9.0 lib/opentelemetry/instrumentation/concurrent_ruby/patches/future.rb
opentelemetry-instrumentation-concurrent_ruby-0.8.0 lib/opentelemetry/instrumentation/concurrent_ruby/patches/future.rb
opentelemetry-instrumentation-concurrent_ruby-0.7.0 lib/opentelemetry/instrumentation/concurrent_ruby/patches/future.rb
opentelemetry-instrumentation-concurrent_ruby-0.6.0 lib/opentelemetry/instrumentation/concurrent_ruby/patches/future.rb
opentelemetry-instrumentation-concurrent_ruby-0.5.0 lib/opentelemetry/instrumentation/concurrent_ruby/patches/future.rb