-
Notifications
You must be signed in to change notification settings - Fork 179
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
Couldn't catch exception from Rails controller #635
Comments
Thanks for opening this issue. Would you be interested in opening a PR to add functionality that records handled errors on the rack spans? |
Would love to. Just need to find right place to throw the exception. |
You may want to have a look at dd-trace-rb or other vendor specific implementations to see if they figured out some way of dealing with this scenario. I assert that it's one of the Rails libraries that is capturing the exception and reporting it back to rack in some way. I think that also varies in what mode the rails app is running in, e.g. in development ActionDispatch::DebugExceptions intercepts the raised exception and shows a debugging page. Error handlers like airbrake or sentry may intercept them and handle them in a different way. Application developers may also use Please let us know what you find out and thank you again for being willing to help. |
If the application is handling the exception (whether using |
👋 This issue has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the |
resolved in #703 |
Description of the bug
If rails controller has error, then there is no exception_event from span.
For example, below is a sample rails controller, and
create_error
is not defined fromUser
, so it should create errorThe sample span from above call
Even though the status_code is 500, but there is no exception.
I checked the opentelemetry-instrumentation-rack between L81-L82, there is no
record_exception
even thestatus
is 500. I addedrequest_span.record_exception(Exception.new) if status == 500
between 81 and 82, and rack span can create exception_event.I tried to produce error from action_view, and the exception was caught in span.
I am wondering is there particular reason or the error should be handled in somewhere else?
Similar issue I found is #56
Share details about your runtime
Operating system details: Debian GNU/Linux aarch64 GNU/Linux
RUBY_ENGINE: "ruby"
RUBY_VERSION: "3.1.0"
RUBY_DESCRIPTION: "ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [aarch64-linux]"
Share a simplified reproduction if possible
opentelemetry-version
The text was updated successfully, but these errors were encountered: