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

Not every exception is a 500 #103

Closed
sj26 opened this issue Apr 5, 2017 · 1 comment
Closed

Not every exception is a 500 #103

sj26 opened this issue Apr 5, 2017 · 1 comment
Labels
bug Involves a bug
Milestone

Comments

@sj26
Copy link

sj26 commented Apr 5, 2017

I noticed you've actually highlighted this in the current tracer code:

https://github.com/DataDog/dd-trace-rb/blob/master/lib/ddtrace/contrib/rails/action_controller.rb#L66-L68

Not every exception raised during controller processing maps to a 500 response. By default, current rails inserts the ActionDispatch::ShowExceptions middleware which calculates the appropriate status code for an exception using ActionDispatch::ExceptionWrapper. You could also call the exception wrapper to calculate the probable status code for any exception so that it is more accurate.

We recently starting using ShowExceptions more for serving proper dynamic 404 pages and rely on ExceptionWrapper to translate common exceptions into client errors (4XX response) which we don't care about, but these responses now appear incorrectly in Datadog APM as Error responses with 500 response codes.

P.S. Really enjoying watching the product grow!

@ufoot
Copy link
Member

ufoot commented Apr 5, 2017

Oh, interesting indeed. Thanks for the feedback. We need to address this, translating 4xx to 5xx is clearly not the right thing to do.

@ufoot ufoot added the bug Involves a bug label Apr 5, 2017
@ufoot ufoot modified the milestones: 0.6.2, 0.7.0 Apr 6, 2017
@ufoot ufoot modified the milestones: 0.7.0, 0.7.1 Apr 21, 2017
@ufoot ufoot modified the milestones: 0.7.2, 0.7.1 May 10, 2017
@ufoot ufoot modified the milestones: 0.7.3, 0.7.2 May 24, 2017
@ufoot ufoot modified the milestones: 0.7.3, 0.8.0 Jul 21, 2017
@ufoot ufoot closed this as completed Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug
Projects
None yet
Development

No branches or pull requests

2 participants