Skip to content

Commit fd6cf40

Browse files
committed
Track request queue time in sentry-rails
Ensure the default behavior of start_transaction from the parent class `Sentry::Rack::CaptureExceptions` is executed when using Rails.
1 parent faa2853 commit fd6cf40

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

sentry-rails/lib/sentry/rails/capture_exceptions.rb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,11 @@ def capture_exception(exception, env)
3636
end
3737

3838
def start_transaction(env, scope)
39-
options = {
40-
name: scope.transaction_name,
41-
source: scope.transaction_source,
42-
op: transaction_op,
43-
origin: SPAN_ORIGIN
44-
}
45-
46-
if @assets_regexp && scope.transaction_name.match?(@assets_regexp)
47-
options.merge!(sampled: false)
39+
super do
40+
if @assets_regexp && scope.transaction_name.match?(@assets_regexp)
41+
options.merge!(sampled: false)
42+
end
4843
end
49-
50-
transaction = Sentry.continue_trace(env, **options)
51-
Sentry.start_transaction(transaction: transaction, custom_sampling_context: { env: env }, **options)
5244
end
5345

5446
def show_exceptions?(exception, env)

sentry-ruby/lib/sentry/rack/capture_exceptions.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def start_transaction(env, scope)
7171
origin: SPAN_ORIGIN
7272
}
7373

74+
yield if block_given?
75+
7476
transaction = Sentry.continue_trace(env, **options)
7577
transaction = Sentry.start_transaction(transaction: transaction, custom_sampling_context: { env: env }, **options)
7678

0 commit comments

Comments
 (0)