Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Do not log Sentry.CrashError to Sentry

Uku Taht6fbb0a24a82c
diff --git a/config/runtime.exs b/config/runtime.exs
index 37bd592a58..5096c64ea2 100644
--- a/config/runtime.exs
+++ b/config/runtime.exs
@@ -229,7 +229,8 @@ config :sentry,
enable_source_code_context: true,
root_source_code_path: [File.cwd!()],
client: Plausible.Sentry.Client,
- send_max_attempts: 2
+ send_max_attempts: 1,
+ filter: Plausible.SentryFilter
config :logger, Sentry.LoggerBackend,
capture_log_messages: true,
diff --git a/lib/sentry_filter.ex b/lib/sentry_filter.ex
new file mode 100644
index 0000000000..7c7f7219d7
--- /dev/null
+++ b/lib/sentry_filter.ex
@@ -0,0 +1,6 @@
+defmodule Plausible.SentryFilter do
+ @behaviour Sentry.EventFilter
+
+ def exclude_exception?(%Sentry.CrashError{}, _source), do: true
+ def exclude_exception?(exception, source), do: false
+end