Sha256: 6870d74804183018839964b297ab1e952c0d022dcaeb557c41db74d49164c192

Contents?: true

Size: 695 Bytes

Versions: 15

Compression:

Stored size: 695 Bytes

Contents

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

module NewRelic
  module Agent
    module Instrumentation
      module MonitoredThread
        attr_reader :nr_parent_key

        def initialize_with_newrelic_tracing
          @nr_parent_key = NewRelic::Agent::Tracer.current_segment_key
          yield
        end

        def add_thread_tracing(*args, &block)
          return block if !NewRelic::Agent::Tracer.thread_tracing_enabled?

          NewRelic::Agent::Tracer.thread_block_with_current_transaction(&block)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
newrelic_rpm-9.17.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.16.1 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.16.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.15.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.14.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.13.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.12.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.11.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.10.2 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.10.1 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.10.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.9.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.8.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.7.1 lib/new_relic/agent/instrumentation/thread/instrumentation.rb
newrelic_rpm-9.7.0 lib/new_relic/agent/instrumentation/thread/instrumentation.rb