Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wttj-tech/876ebfd10aadd8220a4f81c4411f4761 to your computer and use it in GitHub Desktop.
Save wttj-tech/876ebfd10aadd8220a4f81c4411f4761 to your computer and use it in GitHub Desktop.
observability_noise_reduction_sentry_event_filter.ex
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