Skip to content

Replace rollbar with sentry #102

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

Merged
merged 1 commit into from
Dec 15, 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
6 changes: 1 addition & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: CI

on:
pull_request:
push:
branches:
- master
on: [push, pull_request]

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN mix compile

# build release
COPY rel rel
RUN mix release
RUN mix do sentry.package_source_code, release

# prepare release image
FROM alpine:3.15.3 AS app
Expand Down
2 changes: 0 additions & 2 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# is restricted to this project.

# General application configuration
use Mix.Config

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

Check warning on line 8 in config/config.exs

View workflow job for this annotation

GitHub Actions / test

use Mix.Config is deprecated. Use the Config module instead

config :diff,
cache_version: 2,
Expand All @@ -31,8 +31,6 @@
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason

config :rollbax, enabled: false

# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"
7 changes: 3 additions & 4 deletions config/prod.exs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ config :diff,

config :sasl, sasl_error_logger: false

config :rollbax,
environment: "prod",
enabled: true,
enable_crash_reports: true
config :sentry,
enable_source_code_context: true,
root_source_code_paths: [File.cwd!()]

config :logger,
level: :info,
Expand Down
4 changes: 3 additions & 1 deletion config/releases.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ config :diff,

config :goth, json: System.fetch_env!("DIFF_GCP_CREDENTIALS")

config :rollbax, access_token: System.fetch_env!("DIFF_ROLLBAR_ACCESS_TOKEN")
config :sentry,
dsn: System.fetch_env!("DIFF_SENTRY_DSN"),
environment_name: System.fetch_env!("DIFF_ENV")

config :kernel,
inet_dist_listen_min: String.to_integer(System.fetch_env!("BEAM_PORT")),
Expand Down
2 changes: 2 additions & 0 deletions lib/diff/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ defmodule Diff.Application do
use Application

def start(_type, _args) do
:logger.add_handler(:sentry_handler, Sentry.LoggerHandler, %{})

# List all child processes to be supervised
children = [
{Task.Supervisor, name: Diff.Tasks},
Expand Down
2 changes: 2 additions & 0 deletions lib/diff_web/endpoint.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule DiffWeb.Endpoint do
use Sentry.PlugCapture
use Phoenix.Endpoint, otp_app: :diff

socket "/live", Phoenix.LiveView.Socket
Expand Down Expand Up @@ -32,6 +33,7 @@ defmodule DiffWeb.Endpoint do
pass: ["*/*"],
json_decoder: Phoenix.json_library()

plug Sentry.PlugContext
plug Plug.MethodOverride
plug Plug.Head

Expand Down
42 changes: 0 additions & 42 deletions lib/diff_web/plugs/rollbax.ex

This file was deleted.

1 change: 0 additions & 1 deletion lib/diff_web/router.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
defmodule DiffWeb.Router do
use DiffWeb, :router
use Plug.ErrorHandler
use DiffWeb.Plugs.Rollbax

import Phoenix.LiveView.Router

Expand Down
22 changes: 11 additions & 11 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ defmodule Diff.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.6"},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix_html, "~> 3.2"},
{:floki, "~> 0.32.0"},
{:gettext, "~> 0.11"},
{:git_diff, github: "ericmj/git_diff", branch: "ericmj/fix-modes"},
{:goth, "~> 1.0"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.1"},
{:phoenix_live_view, "~> 0.6"},
{:hackney, "~> 1.15"},
{:hex_core, "~> 0.8.0"},
{:rollbax, "~> 0.11.0"},
{:jason, "~> 1.0"},
{:logster, "~> 1.0"},
{:git_diff, github: "ericmj/git_diff", branch: "ericmj/fix-modes"},
{:hackney, "~> 1.15"},
{:floki, "~> 0.32.0"},
{:mox, "~> 1.0.0", only: :test},
{:phoenix_html, "~> 3.2"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:mox, "~> 1.0.0", only: :test}
{:phoenix_live_view, "~> 0.6"},
{:phoenix_pubsub, "~> 2.0"},
{:phoenix, "~> 1.6"},
{:plug_cowboy, "~> 2.1"},
{:sentry, "~> 10.2"}
]
end

Expand Down
4 changes: 3 additions & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
"mime": {:hex, :mime, "2.0.2", "0b9e1a4c840eafb68d820b0e2158ef5c49385d17fb36855ac6e7e087d4b1dcc5", [:mix], [], "hexpm", "e6a3f76b4c277739e36c2e21a2c640778ba4c3846189d5ab19f97f126df5f9b7"},
"mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},
"mox": {:hex, :mox, "1.0.1", "b651bf0113265cda0ba3a827fcb691f848b683c373b77e7d7439910a8d754d6e", [:mix], [], "hexpm", "35bc0dea5499d18db4ef7fe4360067a59b06c74376eb6ab3bd67e6295b133469"},
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},
"nimble_ownership": {:hex, :nimble_ownership, "0.3.2", "d4fa4056ade0ae33b5a9eb64554a1b3779689282e37513260125d2d6b32e4874", [:mix], [], "hexpm", "28b9a9f4094fda1aa8ca72f732ff3223eb54aa3eda4fed9022254de2c152b138"},
"parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"},
"phoenix": {:hex, :phoenix, "1.6.7", "f1de32418bbbcd471f4fe74d3860ee9c8e8c6c36a0ec173be8ff468a5d72ac90", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b354a4f11d9a2f3a380fb731042dae064f22d7aed8c7e7c024a2459f12994aad"},
"phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"},
Expand All @@ -32,7 +34,7 @@
"plug_cowboy": {:hex, :plug_cowboy, "2.5.2", "62894ccd601cf9597e2c23911ff12798a8a18d237e9739f58a6b04e4988899fe", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ea6e87f774c8608d60c8d34022a7d073bd7680a0a013f049fc62bf35efea1044"},
"plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"rollbax": {:hex, :rollbax, "0.11.0", "9557935d09d154c8775fa4efc709bfacbb73f20c58a3ced31dea2a74dd6e25de", [:mix], [{:hackney, "~> 1.1", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "a74318b175aae4bdddcc1ecfdf38755df3d8143c9902b1bfd19507ac9901062d"},
"sentry": {:hex, :sentry, "10.4.0", "d8ffe8ce15b4b53f5e879299c3c222324c289a47a507c0b251c4f91ce7bae9ff", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_options, "~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_ownership, "~> 0.3.0", [hex: :nimble_ownership, repo: "hexpm", optional: false]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "e5f98892152879dc87363b1b7f774eeddb8cf7dddfa7355e40eba188b2cae58a"},
"ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.6", "cf344f5692c82d2cd7554f5ec8fd961548d4fd09e7d22f5b62482e5aeaebd4b0", [:make, :mix, :rebar3], [], "hexpm", "bdb0d2471f453c88ff3908e7686f86f9be327d065cc1ec16fa4540197ea04680"},
"telemetry": {:hex, :telemetry, "1.1.0", "a589817034a27eab11144ad24d5c0f9fab1f58173274b1e9bae7074af9cbee51", [:rebar3], [], "hexpm", "b727b2a1f75614774cff2d7565b64d0dfa5bd52ba517f16543e6fc7efcc0df48"},
"unicode_util_compat": {:hex, :unicode_util_compat, "0.7.0", "bc84380c9ab48177092f43ac89e4dfa2c6d62b40b8bd132b1059ecc7232f9a78", [:rebar3], [], "hexpm", "25eee6d67df61960cf6a794239566599b09e17e668d3700247bc498638152521"},
Expand Down
Loading