Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

rails.request.exceptions also reports intended exceptions #87

Open
OleMchls opened this issue Jul 30, 2014 · 9 comments
Open

rails.request.exceptions also reports intended exceptions #87

OleMchls opened this issue Jul 30, 2014 · 9 comments
Milestone

Comments

@OleMchls
Copy link

Hey there,

so we just found some strange exceptions in our graphs. After digging into it, I found that actually when Rails raise RecordNotFound, error it will also appear in our graphs as rails.request.exceptions which is somehow technically right.

As you can see here

exception = event.payload[:exception]
exception is :exception=>["ActiveRecord::RecordNotFound", "Couldn't find Design with 'id'=276"]

But then Rails answers the HTTP request with a HTTP 404 which is again correct. But I do not have any other graph indicating exceptions. So what I miss is a way to graph all exceptions which actually cause our system to fail.

Any ideas? Thoughts?

@nextmat
Copy link
Contributor

nextmat commented Jul 30, 2014

Hmm. Yes, this is a tricky issue because what we are reporting is the number of exceptions that are bubble out of a controller actions to the layer above. The global exception handlers for things like RecordNotFound are above the instrumented layer, so they appear in that count.

Did you write your own handler for the RecordNotFound exceptions or are you using the default Rails one?

@OleMchls
Copy link
Author

We rely on the default Rails implementation. As a work around we're using rails.request.exceptions for now. But in general I'd like to have a metric for actual failures. Maybe something like bugsnack or new relic tracking. I guess they are just trapping a exit or a exception which causes the process to fail.

@nextmat
Copy link
Contributor

nextmat commented Jul 30, 2014

Does rack.request.exceptions give you a more accurate number?

@OleMchls
Copy link
Author

More accurate? - maybe.
Correct? - I don't know.

But! The RecordNotFound exceptions are not included, that is what I know
for sure :D But it feels more like a workaround, but at least fixes my
problem for now.

On Thu, Jul 31, 2014 at 12:16 AM, Matt Sanders [email protected]
wrote:

Does rack.request.exceptions give you a more accurate number?


Reply to this email directly or view it on GitHub
#87 (comment)
.

@OleMchls
Copy link
Author

What do you mean with accurate? It's more like what I would expect. Even if
I still don't know what it tracks exactly. But I've checked and at least
the RecordNotFound errors are not tracked by that :)

On Thursday, July 31, 2014, Matt Sanders [email protected] wrote:

Does rack.request.exceptions give you a more accurate number?


Reply to this email directly or view it on GitHub
#87 (comment)
.

@nextmat
Copy link
Contributor

nextmat commented Jul 30, 2014

Right, so rack.request.exceptions gives you the number of exceptions that reach the middleware stack (and aren't caught in it), so it should include exceptions that aren't being handled by rails. Sounded like that might be more what you wanted.

@OleMchls
Copy link
Author

True, but then I'd propose for this gem to get rid of rails.request.exceptions because it submits falsy values, and as of rack.request.exceptions is anyway part of this gem it won't confuse future users 😉

@nextmat
Copy link
Contributor

nextmat commented Aug 15, 2014

@jderrett @kellym any thoughts on this?

@nextmat
Copy link
Contributor

nextmat commented May 9, 2016

Just following up on this after lots of thought. I'd like to drop reporting this entirely in our next major ver as I think it does more harm than good. /cc @chancefeick @bdehamer

@nextmat nextmat added this to the v2.0 milestone May 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants