For rack middleware, it's already implemented in #1749
But since the start_transaction is overridden in Rails middleware, so request info is not available in sampling context when using with Rails app
|
def start_transaction(env, scope) |
|
sentry_trace = env["HTTP_SENTRY_TRACE"] |
|
options = { name: scope.transaction_name, op: transaction_op } |
|
|
|
if @assets_regex && scope.transaction_name.match?(@assets_regex) |
|
options.merge!(sampled: false) |
|
end |
|
|
|
transaction = Sentry::Transaction.from_sentry_trace(sentry_trace, **options) if sentry_trace |
|
Sentry.start_transaction(transaction: transaction, **options) |
For rack middleware, it's already implemented in #1749
But since the
start_transactionis overridden in Rails middleware, so request info is not available in sampling context when using with Rails appsentry-ruby/sentry-rails/lib/sentry/rails/capture_exceptions.rb
Lines 33 to 42 in 9f6ab0c