The profiler is shipped within Datadog tracing libraries. If you are already using APM to collect traces for your application, you can skip installing the library and go directly to enabling the profiler.
The Datadog Profiler requires Ruby 2.5+ (Ruby 3.1+ or later is recommended). JRuby and TruffleRuby are not supported.
The following operating systems and architectures are supported:
Linux (GNU libc) x86-64, aarch64
Alpine Linux (musl libc) x86-64, aarch64
You also need either the pkg-config or the pkgconf system utility installed.
This utility is available on the software repositories of most Linux distributions. For example:
The pkg-config package is available for Homebrew, and Debian- and Ubuntu-based Linux
The pkgconf package is available for Arch- and Alpine-based Linux
The pkgconf-pkg-config package is available for Fedora- and Red-Hat-based Linux
Continuous Profiler is not supported on serverless platforms, such as AWS Lambda.
Note: For Rails applications, create a config/initializers/datadog.rb file with the code configuration above.
Add the ddprofrb exec command to your Ruby application start command:
bundle exec ddprofrb exec ruby myapp.rb
Rails example:
bundle exec ddprofrb exec bin/rails s
If you’re running a version of the gem older than 1.21.0, replace ddprofrb exec with ddtracerb exec.
Note
If starting the application with ddprofrb exec is not an option (for example, when using the Phusion Passenger web server), you can alternatively start the profiler by adding the following to your application entry point (such as config.ru, for a web application):
require'datadog/profiling/preload'
Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
A minute or two after starting your Ruby application, your profiles will show up on the Datadog APM > Profiler page.
The Getting Started with Profiler guide takes a sample service with a performance problem and shows you how to use Continuous Profiler to understand and fix the problem.