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 an option to ignore an entire exception #308

Open
kennethito opened this issue Aug 17, 2020 · 8 comments
Open

Add an option to ignore an entire exception #308

kennethito opened this issue Aug 17, 2020 · 8 comments

Comments

@kennethito
Copy link
Contributor

I see that you can filter out parts of an exception, but I was wondering if there was a way to selectively ignore and not notify an entire exception.

Use case. The version of cowboy we are on generates an exception for certain characters in urls via :cow_uri.urldecode/2 . We've had millions of these in the last week due to people probing our site and blew through our honeybadger plan. I'm looking for a way to ignore or rate limit these exceptions.

@joshuap
Copy link
Member

joshuap commented Aug 17, 2020

@kennethito you can ignore the error in the Honeybadger UI and we'll stop alerting you about it, but I don't think we have a way to completely ignore the error in the client, which would be better (since then it wouldn't be sent to our servers at all). @sorentwo we don't currently have a solution for this that I am missing, do we?

@kennethito
Copy link
Contributor Author

kennethito commented Aug 17, 2020

Gotcha.

@joshuap Ignoring the error in the Honeybadger UI doesn't prevent the error from consuming your quota correct?

@sorentwo
Copy link
Collaborator

@sorentwo we don't currently have a solution for this that I am missing, do we?

No, there isn't any way to declare that certain exceptions should be ignored on the client side currently.

@joshuap
Copy link
Member

joshuap commented Aug 26, 2020

Ignoring the error in the Honeybadger UI doesn't prevent the error from consuming your quota correct?

Correct, they do not consume quota!

In any case, I think this is a feature we want to eventually add, so I'll leave this open to track it.

@joshuap joshuap changed the title Is there a way to ignore an entire exception? Add an option to ignore an entire exception Aug 26, 2020
@sezaru
Copy link
Contributor

sezaru commented Feb 19, 2021

Is this still a wanted feature? If I create a PR to support filtering out exceptions would it be considered to be merged?

@joshuap
Copy link
Member

joshuap commented Feb 19, 2021

@sezaru yeah, I would like this feature. What kind of configuration API are you thinking? @sorentwo, do you have any thoughts on the best approach?

Here's how we do this in Ruby and JavaScript:

https://docs.honeybadger.io/lib/ruby/getting-started/ignoring-errors.html
https://docs.honeybadger.io/lib/javascript/guides/reducing-noise.html

@sezaru
Copy link
Contributor

sezaru commented Feb 19, 2021

I was thinking about a very simple behaviour with a single filter/1 function that receives the Notify struct and the user can define its own logic to when and how he wants to filter the exception.

Thanks for the links, I just took a fast look at it and it seems that they allow more complex filter cases like by exception type, etc.

For my use case, only the behaviour described above is enough, but if it is desirable, I could simply have some already implemented adapters for that behaviour for each use case.

For example, an adapter that reads a config with the exception types they want to ignore and filters then, etc.

Do you have any better suggestion or something like that would do?

Also, one thing that would be nice to have as documentation is an explanation of how Honeybadger defines errors equality. As far as I know it its the error title plus the error stack trace, but maybe there is some other thing, knowing that would be great to the user who wants to use this so he can filter the messages in a more "fine-tuned" way.

PS. For my use case, I want to create a separated GenServer that will store a state with counters of how many each type of errors (defined as title + stack trace for now) was triggered in a time period, let's say a max of 10 errors in a 10 minute period, and each minute that counter would subtract one. Something like a rate-limit fashion per error type.

@joshuap
Copy link
Member

joshuap commented Feb 19, 2021

Also, one thing that would be nice to have as documentation is an explanation of how Honeybadger defines errors equality. As far as I know it its the error title plus the error stack trace, but maybe there is some other thing, knowing that would be great to the user who wants to use this so he can filter the messages in a more "fine-tuned" way.

Oh yeah, our Elixir docs are lacking on this atm—I'm making a note about that. In the meantime, here's our Ruby guide on how we group errors (which is the same for Elixir by default). We support a number of custom fingerprint options in the Elixir client.

Regarding the API, I think the option to ignore errors with a Notice struct could work, but I'm less sure about naming the method/option filter/1, since we already have a number of filter config options which serve a different purpose. /cc @sorentwo @rabidpraxis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants