Created
September 13, 2023 09:04
-
-
Save wttj-tech/876ebfd10aadd8220a4f81c4411f4761 to your computer and use it in GitHub Desktop.
observability_noise_reduction_sentry_event_filter.ex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Sentry.DefaultEventFilter do | |
@behaviour Sentry.EventFilter | |
@moduledoc false | |
@ignored_exceptions [ | |
Phoenix.NotAcceptableError, | |
Phoenix.Router.NoRouteError, | |
Plug.Conn.InvalidQueryError, | |
Plug.Parsers.BadEncodingError, | |
Plug.Parsers.ParseError, | |
Plug.Parsers.RequestTooLarge, | |
Plug.Parsers.UnsupportedMediaTypeError, | |
Plug.Static.InvalidPathError | |
] | |
def exclude_exception?(%x{}, :plug) when x in @ignored_exceptions do | |
true | |
end | |
def exclude_exception?(%FunctionClauseError{function: :do_match, arity: 4}, :plug), do: true | |
def exclude_exception?(_, _), do: false | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment