From 5ba8697c31250e5d968cd103c172ade54f903718 Mon Sep 17 00:00:00 2001 From: Adam Rutkowski Date: Mon, 16 Jan 2023 13:05:56 +0100 Subject: [PATCH] Fingerprint DBConnection.ConnectionError in Sentry (#2597) --- lib/sentry_filter.ex | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/sentry_filter.ex b/lib/sentry_filter.ex index 700888030..be9c81ba7 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