tomekowal

tomekowal

What errors do you filter out from Sentry?

I am using Sentry 8 from Hex README — Sentry v13.2.0 and I see it reports lots of errors that are perfectly normal for Phoenix apps, e.g.

%Ecto.NoResultsError{} happens when someone mistypes an id in the URL. It is converted properly to 404.

%Plug.CSRFProtection.InvalidCSRFTokenError{} happens always when session ends and user tries to back-navigate. It is properly handled in a default setup.

%Plug.Conn.InvalidQueryError{} when someone mistypes a URL.

%Phoenix.NotAcceptableError{} happens when someone tries to use wrong content-type.

All of those are handled in the default configuration and properly converted to a correct HTTP error.
Should I simply add all Plug events to Sentry event filter? At least those that have designated HTTP error code?

Most Liked

jeroenbourgois

jeroenbourgois

The type of error you list there are things we generally check for in our controllers and/or service layer. In any case these are not the types we tend to let leak to the outer layer, so we do something with them. We do indeed have the occasional invalid JSON posts when a crawler passes by, but no filters at all.

Our strategy towards Sentry is to handle/catch every error in our app, Sentry should be silent.

Last Post!

jeroenbourgois

jeroenbourgois

Well to be honest, while re-reading the OP question, I have to say some might be valid to just let pass… But the reason we want our Sentry to be silent is because errors that occur there should be unexpected. If you have error occur constantly then it will make you ignore Sentry, which is not what you want.

For the first one (%Ecto.NoResulsError{}) I would just catch that in the controller where you get the resource and show a flash message or redirect alltogether. The second one might something you can just fail on its own, but the last two again I would handle in the controller and either show an appropriate flash message.

Where Next?

Popular in Questions Top

baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement