Add db timeout error grouping in sentry

This commit is contained in:
Simon Prévost 2022-03-18 07:01:03 -04:00
parent 8e5ff1143f
commit 9c57b53904
3 changed files with 11 additions and 1 deletions

View File

@ -33,6 +33,7 @@ config :tesla,
adapter: Tesla.Adapter.Hackney
config :sentry,
before_send_event: {Accent.Sentry, :before_send},
release: version
config :ueberauth, Ueberauth, providers: []

View File

@ -126,7 +126,7 @@ else
config :sentry,
dsn: System.get_env("SENTRY_DSN"),
environment_name: System.get_env("SENTRY_ENVIRONMENT_NAME"),
included_environments: ~w(prod production),
included_environments: ~w(dev prod production),
root_source_code_path: File.cwd!()
end

9
lib/accent/sentry.ex Normal file
View File

@ -0,0 +1,9 @@
defmodule Accent.Sentry do
def before_send(%{exception: [%{type: DBConnection.ConnectionError}]} = event) do
%{event | fingerprint: ~w(ecto db_connection timeout)}
end
def before_send(event) do
event
end
end