Set Up Profiling

With profiling, Sentry allows you to collect and analyze performance profiles from real user devices in production to give you a complete picture of how your application performs in a variety of environments.

Enable Performance Monitoring

Profiling depends on Sentry’s performance monitoring product being enabled beforehand. To enable performance monitoring in the SDK:

Sentry.init do |config|
  config.dsn = ''
  config.traces_sample_rate = 1.0

Check out the performance setup documentation for more detailed information on how to configure sampling. Setting the sample rate to 1.0 means all transactions will be captured.

Enable Profiling

We use the stackprof gem to collect profiles for Ruby.

First add stackprof to your Gemfile and make sure it is loaded before sentry-ruby.

# Gemfile

gem 'stackprof'
gem 'sentry-ruby'

Then, make sure both traces_sample_rate and profiles_sample_rate are set and non-zero in your sentry initializer.

# config/initializers/sentry.rb

Sentry.init do |config|
  config.dsn = ""
  config.traces_sample_rate = 1.0
  config.profiles_sample_rate = 1.0


If you don't see any profiling data in, you can try the following:

  • Ensure that performance monitoring is enabled.
  • Ensure that the automatic instrumentation is sending performance data to Sentry by going to the Performance page in
  • If the automatic instrumentation is not sending performance data, try using custom instrumentation.
  • Enable debug mode in the SDK and check the logs.


Profiles for multi-threaded servers like puma might not capture frames correctly when async I/O is happening. This is a limitation of stackprof.

Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").