diff --git a/lib/ddtrace/profiling/collectors/stack.rb b/lib/ddtrace/profiling/collectors/stack.rb index 9afcf590033..07b5e8c494c 100644 --- a/lib/ddtrace/profiling/collectors/stack.rb +++ b/lib/ddtrace/profiling/collectors/stack.rb @@ -224,6 +224,7 @@ def warn_about_missing_cpu_time_instrumentation(thread) # In this case, the fix is to make sure ddtrace gets loaded before any other parts of the application. # # b) The thread was started using the Ruby native APIs (e.g. from a C extension such as ffi). + # Known cases right now that trigger this are the ethon/typhoeus gems. # We currently have no solution for this case; these threads will always be missing our CPU instrumentation. # # c) The thread was started with `Thread.start`/`Thread.fork` and hasn't yet enabled the instrumentation. @@ -232,7 +233,9 @@ def warn_about_missing_cpu_time_instrumentation(thread) # it to run and our instrumentation to be applied. # if thread_api.current.respond_to?(:cpu_time) && thread_api.current.cpu_time - Datadog.logger.debug("Detected thread ('#{thread}') with missing CPU profiling instrumentation.") + Datadog.logger.debug( + "Thread ('#{thread}') is missing profiling instrumentation; other threads should be unaffected" + ) end end end diff --git a/spec/ddtrace/profiling/collectors/stack_spec.rb b/spec/ddtrace/profiling/collectors/stack_spec.rb index 3f2dcfc3d52..edb46076bb7 100644 --- a/spec/ddtrace/profiling/collectors/stack_spec.rb +++ b/spec/ddtrace/profiling/collectors/stack_spec.rb @@ -427,7 +427,7 @@ it { is_expected.to be nil } it 'logs a warning' do - expect(Datadog.logger).to receive(:debug).with(/missing CPU profiling instrumentation/) + expect(Datadog.logger).to receive(:debug).with(/missing profiling instrumentation/) get_cpu_time_interval! end