Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request info to custom_sampling_context in Rails middleware #1791

Closed
linhmtran168 opened this issue Apr 13, 2022 · 0 comments · Fixed by #1792
Closed

Add request info to custom_sampling_context in Rails middleware #1791

linhmtran168 opened this issue Apr 13, 2022 · 0 comments · Fixed by #1792

Comments

@linhmtran168
Copy link
Contributor

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)

@st0012 st0012 added this to To do in 5.x via automation Apr 13, 2022
@st0012 st0012 added this to the 5.3.0 milestone Apr 13, 2022
5.x automation moved this from To do to Done Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
5.x
Done
Development

Successfully merging a pull request may close this issue.

2 participants