Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove rollbar #436

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions apps/cf/config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ config :cf,

config :guardian, Guardian.DB, repo: DB.Repo

# Configure Rollbar (errors reporting)
config :rollbax,
enabled: :log

config :scout_apm,
name: "CaptainFact",
key: {:system, "CF_SCOUT_APM_KEY"}
Expand Down
4 changes: 0 additions & 4 deletions apps/cf/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ config :logger, :console, format: "[$level] $message\n"
# in production as building large stacktraces may be expensive.
config :phoenix, :stacktrace_depth, 20

# Configure Rollbar (errors reporting)
config :rollbax,
environment: "dev"

# Mails
config :cf, CF.Mailer, adapter: Bamboo.LocalAdapter

Expand Down
5 changes: 0 additions & 5 deletions apps/cf/config/prod.exs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
use Mix.Config

# Configure Rollbar (errors reporting)
config :rollbax,
environment: "prod",
enable_crash_reports: true

# Do not print debug messages in production
config :logger, level: :info
4 changes: 0 additions & 4 deletions apps/cf/config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,3 @@ config :bcrypt_elixir, :log_rounds, 4
# Behaviours mock for testing
config :cf, captions_fetcher: CF.Videos.CaptionsFetcherTest
config :cf, use_test_video_metadata_fetcher: true

# Configure Rollbar (errors reporting)
config :rollbax,
environment: "test"
15 changes: 6 additions & 9 deletions apps/cf/lib/errors/errors.ex
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
defmodule CF.Errors do
@moduledoc """
Module to report errors, currenctly plugged on Rollbar with important metadata
added. It mostly mimics `Rollbax` API.
Module to report errors
"""

require Logger

@type cf_error_params :: [
user: DB.Schema.User.t(),
custom: Map.t(),
Expand Down Expand Up @@ -36,13 +37,9 @@ defmodule CF.Errors do

@spec do_report(:error | :exit | :throw, any(), [any()], cf_error_params()) :: :ok
def do_report(type, value, stacktrace, params) do
Rollbax.report(
type,
value,
stacktrace,
params[:custom] || %{},
build_occurence_data(params)
)
# Any call to Sentry, Rollbar, etc. should be done here
Logger.error("[ERROR][#{type}] #{inspect(value)} - #{inspect(stacktrace)}")
:ok
end

defp build_occurence_data(params) do
Expand Down
1 change: 0 additions & 1 deletion apps/cf/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ defmodule CF.Mixfile do
{:bamboo, "~> 1.7.1"},
{:hackney, "~> 1.17"},
{:oauth2, "~> 0.9"},
{:rollbax, ">= 0.0.0"},
{:sweet_xml, "~> 0.6"},
{:burnex, "~> 1.0"},
{:yaml_elixir, "~> 2.9.0"},
Expand Down
8 changes: 0 additions & 8 deletions config/releases.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ end
# ---- [Global config keys] ----

frontend_url = String.trim_trailing(load_secret.("frontend_url")) <> "/"
rollbar_access_token = load_secret.({"rollbar_access_token", nil})

if rollbar_access_token do
config :rollbax,
enabled: true,
access_token: rollbar_access_token,
environment: load_secret.({"rollbar_environment", "production"})
end

# ---- [APP CONFIG] :db ----

Expand Down
1 change: 0 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
"postgrex": {:hex, :postgrex, "0.17.1", "01c29fd1205940ee55f7addb8f1dc25618ca63a8817e56fac4f6846fc2cddcbe", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "14b057b488e73be2beee508fb1955d8db90d6485c6466428fe9ccf1d6692a555"},
"quantum": {:hex, :quantum, "2.3.3", "83f565de81ac43b8fda4dd4266b209eaed29545d1c41e17aa6b75b08736c80f6", [:mix], [{:calendar, "~> 0.17", [hex: :calendar, repo: "hexpm", optional: true]}, {:crontab, "~> 1.1", [hex: :crontab, repo: "hexpm", optional: false]}, {:gen_stage, "~> 0.12", [hex: :gen_stage, repo: "hexpm", optional: false]}, {:swarm, "~> 3.3", [hex: :swarm, repo: "hexpm", optional: false]}, {:timex, "~> 3.1", [hex: :timex, repo: "hexpm", optional: true]}], "hexpm", "01a63089a17f00f360ddad6c2f068c26d4e280999c2a6c2bce170d0bd6b2bd2e"},
"ranch": {:hex, :ranch, "1.3.2", "e4965a144dc9fbe70e5c077c65e73c57165416a901bd02ea899cfd95aa890986", [:rebar3], [], "hexpm", "6e56493a862433fccc3aca3025c946d6720d8eedf6e3e6fb911952a7071c357f"},
"rollbax": {:hex, :rollbax, "0.10.0", "f4f5578767cedd272548d12fa7b14335938ef321e677fc3497d4bd725a193316", [:mix], [{:hackney, "~> 1.1", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "d783640ab1a80fec1b88bd0536ce0a66ed66eb35a289572fedb3da5a865ce460"},
"scout_apm": {:hex, :scout_apm, "1.0.7", "0ca260f2c7f3c29bf6a5b361e90339bdce0a5f3ae0cf7b0ce166bfb22eefb89c", [:mix], [{:approximate_histogram, "~>0.1.1", [hex: :approximate_histogram, repo: "hexpm", optional: false]}, {:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:plug, "~>1.0", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 0.3.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "a4a3c8318fb84e4586e68fcd7e889c5bfe17c1caa218cc6f333fb0e4c0ff4ec1"},
"scrivener": {:hex, :scrivener, "2.7.2", "1d913c965ec352650a7f864ad7fd8d80462f76a32f33d57d1e48bc5e9d40aba2", [:mix], [], "hexpm", "7866a0ec4d40274efbee1db8bead13a995ea4926ecd8203345af8f90d2b620d9"},
"scrivener_ecto": {:hex, :scrivener_ecto, "2.7.0", "cf64b8cb8a96cd131cdbcecf64e7fd395e21aaa1cb0236c42a7c2e34b0dca580", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:scrivener, "~> 2.4", [hex: :scrivener, repo: "hexpm", optional: false]}], "hexpm", "e809f171687806b0031129034352f5ae44849720c48dd839200adeaf0ac3e260"},
Expand Down
Loading