-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continuous Profiler: NameError uninitialized constant Datadog::Profiling::Tasks exception #1545
Comments
Hey @qcam, thanks a lot for the report. That... is really weird.
(My current analysis notes:) It looks like the def build_profiler(settings, agent_settings)
return unless Datadog::Profiling.supported? && settings.profiling.enabled
# Load extensions needed to support some of the Profiling features
Datadog::Profiling::Tasks::Setup.new.run And def self.load_profiling
return false unless supported?
#...
require 'ddtrace/profiling/transport/http'
end
load_profiling if supported? So either something failed during |
Thank you very much for the prompt reply 🙏 . Please see my answers below:
I tried to find logs around the exception but most of it was Puma failing around
Yup, it had been consistently failing on our staging environment.
Yes we are running Puma. Please see the full stack trace below:
Honestly I also found it very weird since I assume |
Thanks for the extra information. I suspect that there may be an issue around the detection of profiler being supported. I believe I have a tentative fix. Would you be willing to try out a branch I just created with that fix, and that also adds a bit more debugging information? If so:
source 'https://s3.amazonaws.com/gems.datadoghq.com/prerelease-v2' do
gem 'ddtrace', '0.49.0.debug.profiler.loading.141136'
end ... or alternatively you can just pull it off of GitHub: gem 'ddtrace', git: 'https://github.com/DataDog/dd-trace-rb', branch: 'debug-profiler-loading'
Thanks, and hopefully we'll have you up and running with the profiler very soon 🎉 |
@ivoanjo many thanks for the help. I will check out the branch. On the other hand, I also did some investigation on my end and realized that I could replicate this locally. My previous require 'ddtrace/profiling/preload'
require ::File.expand_path('config/environment', __dir__)
run Rails.application However if this won't: require ::File.expand_path('config/environment', __dir__)
require 'ddtrace/profiling/preload'
run Rails.application EDITEDIn fact I don't need |
Thanks for the info! It seems to feed into my theory: there's two moments in the code where we check if profiler is "supported": 1) when loading ddtrace (inside preload) and 2) when starting the profiler after The problem is that the code assumes that both checks 1) and 2) will always reach the same conclusion: either profiler is supported, or profiler is not supported. In the problematic case, it looks like in your case check 1 decides that profiler is not supported => doesn't load it, and then check 2 decides that it is => assumes it is loaded and tries to start it. And interestingly enough, it seems that if you move the preload require (or remove it entirely), the check 1 actually passes. 😱 I can definitely remove this assumption between both checks (this is one of the things I included with my test branch above), but if you're up to it, I'd still like to take a look at your logs to try to determine what exactly the profiler thinks is wrong to make it fail the first check, as this should work out of the box for you without needing to fiddle with require order 😄 |
@ivoanjo The profiler is running with latest version of Mind if I ask a #lazyweb question of why I didn't see any memory profiling (like I'd see for other languages like Go)? Do I need to configure something else? Thank you very much for the help! 🙏 Really appreciated. |
Glad your issue was fixed, @qcam :)
It's definitely coming at some point! We want to reach feature-parity with what we provide for those other languages, but I don't have a timeline for it yet. Out of curiosity, was your main use case for profiling the memory profiling features? Or is cpu/wall-clock profiling already valuable to you? Feel free to share any feedback/wins/etc -- we're here for it 🐶 |
Hi 👋 , I would like to report an issue regarding the beta continuous profiler. We encountered some crash due to the exception mentioned in the title after enabling the profiler. The tracer and other features work as usual before and after removing the profiler setup.
Environment
2.7.3
via2.7.3-slim-buster
.ddtrace
gem (0.49.0)google-protobuf
(3.17.2)Our set up
Stacktrace
Please let me know if more info is needed. Thank you 🙏 .
The text was updated successfully, but these errors were encountered: