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

Request status for controllers not working on Rails 6.0.6 #1984

Closed
matheusdc opened this issue Jan 13, 2023 · 1 comment
Closed

Request status for controllers not working on Rails 6.0.6 #1984

matheusdc opened this issue Jan 13, 2023 · 1 comment
Assignees
Milestone

Comments

@matheusdc
Copy link

Issue Description

ActiveSupport from Rails 6.0.6 seems to handle request status the same way as Rails 5.x, so the payload from subscribe_to_event doesn't have the request status on it, leading to unknown statuses for Sentry transactions.

I change the condition on abstract_subscriber.rb file from

if ::Rails.version.to_i == 5

to:

if ::Rails.version.to_f < 6.1

and it properly set the request status.

I can open a PR with this fix.

Reproduction Steps

Install Rails 6.0.6 and add a debugger on subscribe_to_event method in the abstract_subscriber.rb file. The method for Rails 5.x works with Rails 6.0.6 as expected adding the :status to the payload, and the other one leave :status as nil.

Expected Behavior

Request status is present in the event payload and also on Sentry breadcrumbs.

Actual Behavior

Request status is calculated as 0 and Sentry dashboard show transaction as unknown status.

Ruby Version

2.7.2

SDK Version

5.7.0

Integration and Its Version

Rails

Sentry Config

  config.environment = Rails.env
  config.enabled_environments = %w[production, development]
  config.traces_sampler = lambda do |sampling_context|
    sampling_context[:parent_sampled]
  end
@matheusdc
Copy link
Author

This was fixed by #1973.

@st0012 st0012 added this to the 5.8.0 milestone Feb 6, 2023
@st0012 st0012 assigned st0012 and unassigned sl0thentr0py Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants