From 1c6cca84596451a925338b9fa0f118d9616c6ee7 Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Tue, 14 Jul 2026 14:16:58 +0200 Subject: [PATCH] feat(ruby): Add hub_isolation_level --- docs/platforms/ruby/common/configuration/options.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/platforms/ruby/common/configuration/options.mdx b/docs/platforms/ruby/common/configuration/options.mdx index f6df1f277ddfd..7eb6ef17a4a0f 100644 --- a/docs/platforms/ruby/common/configuration/options.mdx +++ b/docs/platforms/ruby/common/configuration/options.mdx @@ -263,6 +263,18 @@ config.trusted_proxies = ["2.2.2.2"] + + +Controls where the SDK stores the current hub, which holds the active scope. The default `:thread` uses thread-local storage. Set it to `:fiber` to use [Fiber Storage](https://docs.ruby-lang.org/en/3.2/Fiber.html#class-Fiber-label-Fiber+Storage) (requires Ruby 3.2+), which prevents cross-request scope contamination on fiber-based servers such as [Falcon](https://github.com/socketry/falcon) and other `async` frameworks. + +```ruby +config.hub_isolation_level = :fiber +``` + +Requesting `:fiber` on Ruby versions below 3.2 logs a warning and falls back to `:thread`. + + + ## Tracing Options