Skip to content

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

Fix Sentry filtering to properly catch noise from DB driver (#6495)

Adrian Gruntkowski9545bcd60f40
diff --git a/lib/sentry_filter.ex b/lib/sentry_filter.ex
index 77edbf59e6..1b538e1729 100644
--- a/lib/sentry_filter.ex
+++ b/lib/sentry_filter.ex
@@ -23,6 +23,15 @@ defmodule Plausible.SentryFilter do
%{event | fingerprint: ["db_connection", reason]}
end
+ def before_send(
+ %{
+ exception: [%{type: "Mint.TransportError"}],
+ original_exception: %{reason: reason}
+ } = event
+ ) do
+ %{event | fingerprint: ["mint_transport", reason]}
+ end
+
def before_send(
%{
exception: [%{type: "Finch.TransportError"}],
@@ -35,7 +44,7 @@ defmodule Plausible.SentryFilter do
def before_send(
%{source: :logger, message: %{formatted: "Ch.Connection (#PID<" <> rest}} = event
) do
- if String.ends_with?(rest, ")) disconnected: ** (Finch.HTTPError) the connection is closed") do
+ if String.ends_with?(rest, ")) disconnected: ** (Mint.HTTPError) the connection is closed") do
false
else
event