Sha256: dd1f05d939275d204fcbee090871a721500b4d365397d6df436637aa0776ba3f

Contents?: true

Size: 722 Bytes

Versions: 8

Compression:

Stored size: 722 Bytes

Contents

# frozen_string_literal: true

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

module OpenTelemetry
  module Instrumentation
    module ConcurrentRuby
      module Patches
        # Concurrent::ThreadPoolExecutor patch for instrumentation
        module ThreadPoolExecutor
          # @see Concurrent::ExecutorService#post
          def post(*args, **kwargs, &task)
            context = OpenTelemetry::Context.current
            return super unless context

            super(*args, **kwargs) do
              OpenTelemetry::Context.with_current(context) do
                task.call(*args, **kwargs)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
opentelemetry-instrumentation-concurrent_ruby-0.21.1 lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb
opentelemetry-instrumentation-concurrent_ruby-0.21.0 lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb
opentelemetry-instrumentation-concurrent_ruby-0.20.1 lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb
opentelemetry-instrumentation-concurrent_ruby-0.20.0 lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb
opentelemetry-instrumentation-concurrent_ruby-0.19.3 lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb
opentelemetry-instrumentation-concurrent_ruby-0.19.2 lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb
opentelemetry-instrumentation-concurrent_ruby-0.19.1 lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb
opentelemetry-instrumentation-concurrent_ruby-0.19.0 lib/opentelemetry/instrumentation/concurrent_ruby/patches/thread_pool_executor.rb