Skip to content

Commit a92833f

Browse files
authored
Filter out driver disconnect error messages (#6047)
They are pure noise as the driver is setup to automatically reconnect since plausible/ch#292.
1 parent 03fa177 commit a92833f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/sentry_filter.ex

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ defmodule Plausible.SentryFilter do
3232
%{event | fingerprint: ["mint_transport", reason]}
3333
end
3434

35+
def before_send(
36+
%{source: :logger, message: %{formatted: "Ch.Connection (#PID<" <> rest}} = event
37+
) do
38+
if String.ends_with?(rest, ")) disconnected: ** (Mint.HTTPError) the connection is closed") do
39+
false
40+
else
41+
event
42+
end
43+
end
44+
3545
def before_send(%{extra: %{request: %Plausible.Ingestion.Request{}}} = event) do
3646
%{event | fingerprint: ["ingestion_request"]}
3747
end

0 commit comments

Comments
 (0)