Sha256: 513de610ca0ce684ea680cad1dc83af924ccd285112428762ab55d00e443a7a7

Contents?: true

Size: 757 Bytes

Versions: 3

Compression:

Stored size: 757 Bytes

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.

module NewRelic
  module Agent
    module Instrumentation
      module MonitoredThread
        attr_reader :nr_parent_thread_id

        def initialize_with_newrelic_tracing
          @nr_parent_thread_id = ::Thread.current.object_id
          yield
        end

        def add_thread_tracing(*args, &block)
          return block if skip_tracing?
          NewRelic::Agent::Tracer.thread_block_with_current_transaction(*args, &block)
        end

        def skip_tracing?
          !NewRelic::Agent.config[:'instrumentation.thread.tracing']
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newrelic_rpm-8.9.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-8.8.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-8.7.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb