Skip to content

Commit

Permalink
Use glitchtip instead of sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
tspenov committed Sep 27, 2024
1 parent f248030 commit 7e130e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ config :sasl, sasl_error_logger: false
# Configures Elixir's Logger
config :logger, :console,
format: {Sanbase.Utils.JsonLogger, :format},
backends: [:console, Sentry.LoggerBackend],
metadata: [:request_id, :api_token, :user_id, :remote_ip, :complexity, :query, :san_balance],
handle_otp_reports: true,
handle_sasl_reports: true
Expand Down
4 changes: 4 additions & 0 deletions lib/sanbase/application/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ defmodule Sanbase.Application do
# Note: Sentry.LoggerBackend now allows to send non-exception errors to sentry, too.
# This is not enabled yet.
{:ok, _} = Logger.add_backend(Sentry.LoggerBackend)

This comment has been minimized.

Copy link
@tspenov

tspenov Sep 27, 2024

Author Contributor

bot sure what should happen with Logger.add_backend(Sentry.LoggerBackend)


# Glitchtip handler: This library comes with a :logger handler to capture error messages coming from process crashes. To enable this, add the handler when your application starts:
:logger.add_handler(:sentry_handler, Sentry.LoggerHandler, %{})

Supervisor.start_link(children, opts)
end

Expand Down
1 change: 1 addition & 0 deletions lib/sanbase_web/router.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule SanbaseWeb.Router do
# credo:disable-for-this-file Credo.Check.Refactor.ModuleDependencies
use SanbaseWeb, :router
use Sentry.PlugCapture

pipeline :admin_pod_only do
plug(SanbaseWeb.Plug.AdminPodOnly)
Expand Down
2 changes: 2 additions & 0 deletions lib/sanbase_web/sanbase_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ defmodule SanbaseWeb do
layout: {SanbaseWeb.Layouts, :app}

unquote(html_helpers())

on_mount Sentry.LiveViewHook
end
end

Expand Down

0 comments on commit 7e130e4

Please sign in to comment.