Sha256: 660a65c0ab166c65e8b38d26ca65c449d0ccd5fc4ac968899351305a38bcb1a8

Contents?: true

Size: 778 Bytes

Versions: 2

Compression:

Stored size: 778 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 Adapters
    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

2 entries across 2 versions & 1 rubygems

Version Path
opentelemetry-adapters-concurrent_ruby-0.4.0 lib/opentelemetry/adapters/concurrent_ruby/patches/future.rb
opentelemetry-adapters-concurrent_ruby-0.3.0 lib/opentelemetry/adapters/concurrent_ruby/patches/future.rb