diff --git a/docs/platforms/ruby/common/profiling/index.mdx b/docs/platforms/ruby/common/profiling/index.mdx index 55284b3ef7b983..6c912a13c5f18d 100644 --- a/docs/platforms/ruby/common/profiling/index.mdx +++ b/docs/platforms/ruby/common/profiling/index.mdx @@ -7,11 +7,11 @@ sidebar_order: 5000 -## Enable Profiling +## Enable Profiling using StackProf -Ruby profiling beta is available starting in SDK version `5.9.0`. +StackProf profiling beta is available starting in SDK version `5.9.0`. @@ -46,3 +46,41 @@ The setting is _relative_ to For Profiling to work, you have to first enable Sentry’s tracing via `traces_sample_rate` (like in the example above). Read our tracing setup documentation to learn how to configure sampling. If you set your sample rate to 1.0, all transactions will be captured. + +## Enable Profiling using Vernier + + + +Vernier profiling beta is available starting in SDK version `5.21.0`. + + + + + +Vernier requires Ruby 3.2.1+ + + + +You can have much better profiles if you're using multi-threaded servers like Puma now by leveraging Vernier. + +First, add `vernier` to your `Gemfile` and make sure it is loaded before `sentry-ruby`. + +```ruby +# Gemfile + +gem 'vernier' +gem 'sentry-ruby' +``` + +Then, set a `profiles_sample_rate` and the new `profiler_class` configuration in your sentry initializer to use the new profiler. + +```ruby +# config/initializers/sentry.rb + +Sentry.init do |config| + config.dsn = "___PUBLIC_DSN___" + config.profiles_sample_rate = 1.0 + config.traces_sample_rate = 1.0 + config.profiler_class = Sentry::Vernier::Profiler +end +```