Skip to content

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

Fingerprint DBConnection.ConnectionError in Sentry (#2597)

Adam Rutkowski5ba8697c3125
diff --git a/lib/sentry_filter.ex b/lib/sentry_filter.ex
index 700888030f..be9c81ba75 100644
--- a/lib/sentry_filter.ex
+++ b/lib/sentry_filter.ex
@@ -27,6 +27,15 @@ defmodule Plausible.SentryFilter do
%{event | fingerprint: ["clickhouse", "db_connection", "protocol_error"]}
end
+ def before_send(
+ %{
+ exception: [%{type: "DBConnection.ConnectionError"}],
+ original_exception: %{reason: reason}
+ } = event
+ ) do
+ %{event | fingerprint: ["db_connection", reason]}
+ end
+
def before_send(event) do
event
end