Skip to content

Commit

Permalink
fix(ruby): Make traces_sampler example safe (#11394)
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py committed Sep 19, 2024
1 parent 70b0f02 commit 038ae7f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Sentry.init do |config|

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

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

0 comments on commit 038ae7f

Please sign in to comment.