Skip to content

Commit

Permalink
Merge pull request #1538 from DataDog/ivoanjo/tweak-debug-message-abo…
Browse files Browse the repository at this point in the history
…ut-missing-instrumentation

Tweak debug message about missing instrumentation
  • Loading branch information
ivoanjo authored Jun 3, 2021
2 parents 0fc00ad + 7d6439f commit 6f005d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/ddtrace/profiling/collectors/stack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/ddtrace/profiling/collectors/stack_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f005d8

Please sign in to comment.