Skip to content

Commit 1295964

Browse files
authored
feat(ruby): add info about profiling using vernier (#11508)
1 parent 2862313 commit 1295964

File tree

1 file changed

+40
-2
lines changed
  • docs/platforms/ruby/common/profiling

1 file changed

+40
-2
lines changed

docs/platforms/ruby/common/profiling/index.mdx

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ sidebar_order: 5000
77
<PlatformContent includePath="profiling/index/preface" />
88
<PlatformContent includePath="profiling/index/why-profiling" />
99

10-
## Enable Profiling
10+
## Enable Profiling using StackProf
1111

1212
<Note>
1313

14-
Ruby profiling beta is available starting in SDK version `5.9.0`.
14+
StackProf profiling beta is available starting in SDK version `5.9.0`.
1515

1616
</Note>
1717

@@ -46,3 +46,41 @@ The <PlatformIdentifier name="profiles_sample_rate" /> setting is _relative_ to
4646
For Profiling to work, you have to first enable Sentry’s tracing via `traces_sample_rate` (like in the example above). Read our <PlatformLink to="/tracing/">tracing setup documentation</PlatformLink> to learn how to configure sampling. If you set your sample rate to 1.0, all transactions will be captured.
4747

4848
</Note>
49+
50+
## Enable Profiling using Vernier
51+
52+
<Note>
53+
54+
Vernier profiling beta is available starting in SDK version `5.21.0`.
55+
56+
</Note>
57+
58+
<Note>
59+
60+
Vernier requires Ruby 3.2.1+
61+
62+
</Note>
63+
64+
You can have much better profiles if you're using multi-threaded servers like Puma now by leveraging Vernier.
65+
66+
First, add `vernier` to your `Gemfile` and make sure it is loaded before `sentry-ruby`.
67+
68+
```ruby
69+
# Gemfile
70+
71+
gem 'vernier'
72+
gem 'sentry-ruby'
73+
```
74+
75+
Then, set a `profiles_sample_rate` and the new `profiler_class` configuration in your sentry initializer to use the new profiler.
76+
77+
```ruby
78+
# config/initializers/sentry.rb
79+
80+
Sentry.init do |config|
81+
config.dsn = "___PUBLIC_DSN___"
82+
config.profiles_sample_rate = 1.0
83+
config.traces_sample_rate = 1.0
84+
config.profiler_class = Sentry::Vernier::Profiler
85+
end
86+
```

0 commit comments

Comments
 (0)