Skip to content

Commit 038ae7f

Browse files
authored
fix(ruby): Make traces_sampler example safe (#11394)
1 parent 70b0f02 commit 038ae7f

File tree

1 file changed

+1
-1
lines changed
  • platform-includes/performance/traces-sampler-as-sampler

1 file changed

+1
-1
lines changed

platform-includes/performance/traces-sampler-as-sampler/ruby.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Sentry.init do |config|
99

1010
# the sampling context also has the full rack environment if you want to check the path directly
1111
rack_env = sampling_context[:env]
12-
return 0.0 if rack_env['PATH_INFO'] =~ /health_check/
12+
return 0.0 if rack_env && rack_env['PATH_INFO'] =~ /health_check/
1313

1414
# transaction_context is the transaction object in hash form
1515
# keep in mind that sampling happens right after the transaction is initialized

0 commit comments

Comments
 (0)