lib/new_relic/agent/instrumentation/thread/instrumentation.rb in newrelic_rpm-8.16.0 vs lib/new_relic/agent/instrumentation/thread/instrumentation.rb in newrelic_rpm-9.0.0
- old
+ new
@@ -4,28 +4,24 @@
module NewRelic
module Agent
module Instrumentation
module MonitoredThread
- attr_reader :nr_parent_thread_id
+ attr_reader :nr_parent_key
def initialize_with_newrelic_tracing
- @nr_parent_thread_id = ::Thread.current.object_id
+ @nr_parent_key = NewRelic::Agent::Tracer.current_segment_key
yield
end
def add_thread_tracing(*args, &block)
- return block if skip_tracing?
+ return block if !NewRelic::Agent::Tracer.thread_tracing_enabled?
NewRelic::Agent::Tracer.thread_block_with_current_transaction(
*args,
segment_name: 'Ruby/Thread',
&block
)
- end
-
- def skip_tracing?
- !NewRelic::Agent.config[:'instrumentation.thread.tracing']
end
end
end
end
end