From 91b34744bb57aa7f4639e6192a9ca21597ca01b1 Mon Sep 17 00:00:00 2001 From: Andrew Fader Date: Sun, 10 Sep 2023 19:40:38 -0400 Subject: [PATCH] install sentry (#1982) Signed-off-by: Andrew Fader --- Gemfile | 2 + Gemfile.lock | 131 ++++++++++++++++++---------------- config/initializers/sentry.rb | 8 +++ 3 files changed, 79 insertions(+), 62 deletions(-) create mode 100644 config/initializers/sentry.rb diff --git a/Gemfile b/Gemfile index b6eef138b..193d26b48 100644 --- a/Gemfile +++ b/Gemfile @@ -106,6 +106,8 @@ gem 'secure_headers', '~> 6.3' # Add hardening measures to HTTP headers # WARNING!!!! gem 'sprockets-rails', '3.4.2' # Rails. Asset precompilation gem 'uglifier', '~> 4.2.0', require: false # Minify JavaScript +gem 'sentry-ruby' +gem 'sentry-rails' group :development, :test do gem 'awesome_print' # Pretty print Ruby objects diff --git a/Gemfile.lock b/Gemfile.lock index 20d01eaef..316cbae1c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,67 +1,67 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.0.7.2) - actionpack (= 7.0.7.2) - activesupport (= 7.0.7.2) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.7.2) - actionpack (= 7.0.7.2) - activejob (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.0.7.2) - actionpack (= 7.0.7.2) - actionview (= 7.0.7.2) - activejob (= 7.0.7.2) - activesupport (= 7.0.7.2) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.7.2) - actionview (= 7.0.7.2) - activesupport (= 7.0.7.2) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.7.2) - actionpack (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.7.2) - activesupport (= 7.0.7.2) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (7.0.7.2) - activesupport (= 7.0.7.2) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.7.2) - activesupport (= 7.0.7.2) - activerecord (7.0.7.2) - activemodel (= 7.0.7.2) - activesupport (= 7.0.7.2) - activestorage (7.0.7.2) - actionpack (= 7.0.7.2) - activejob (= 7.0.7.2) - activerecord (= 7.0.7.2) - activesupport (= 7.0.7.2) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.7.2) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -73,7 +73,7 @@ GEM ast (2.4.2) attr_encrypted (4.0.0) encryptor (~> 3.0.0) - autoprefixer-rails (10.4.13.0) + autoprefixer-rails (10.4.15.0) execjs (~> 2) awesome_print (1.9.2) bcrypt (3.1.19) @@ -155,8 +155,8 @@ GEM gitlab (4.19.0) httparty (~> 0.20) terminal-table (>= 1.5.1) - globalid (1.1.0) - activesupport (>= 5.0) + globalid (1.2.1) + activesupport (>= 6.1) hashdiff (1.0.1) hashie (5.0.0) http_accept_language (2.1.1) @@ -213,7 +213,7 @@ GEM mixlib-shellout method_source (1.0.0) mini_mime (1.1.5) - minitest (5.19.0) + minitest (5.20.0) minitest-reporters (1.6.1) ansi builder @@ -273,7 +273,7 @@ GEM parser (3.2.2.3) ast (~> 2.4.1) racc - pg (1.5.3) + pg (1.5.4) pg_search (2.3.6) activerecord (>= 5.2) activesupport (>= 5.2) @@ -321,20 +321,20 @@ GEM rack-test (2.1.0) rack (>= 1.3) rack-timeout (0.6.3) - rails (7.0.7.2) - actioncable (= 7.0.7.2) - actionmailbox (= 7.0.7.2) - actionmailer (= 7.0.7.2) - actionpack (= 7.0.7.2) - actiontext (= 7.0.7.2) - actionview (= 7.0.7.2) - activejob (= 7.0.7.2) - activemodel (= 7.0.7.2) - activerecord (= 7.0.7.2) - activestorage (= 7.0.7.2) - activesupport (= 7.0.7.2) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 7.0.7.2) + railties (= 7.0.8) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -362,9 +362,9 @@ GEM ruby-progressbar rails_serve_static_assets (0.0.5) rails_stdout_logging (0.0.5) - railties (7.0.7.2) - actionpack (= 7.0.7.2) - activesupport (= 7.0.7.2) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) @@ -404,7 +404,7 @@ GEM ruby-progressbar (1.13.0) ruby2_keywords (0.0.5) rubyzip (2.3.2) - rugged (1.6.3) + rugged (1.7.1) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) @@ -428,6 +428,11 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) + sentry-rails (5.11.0) + railties (>= 5.0) + sentry-ruby (~> 5.11.0) + sentry-ruby (5.11.0) + concurrent-ruby (~> 1.0, >= 1.0.2) sexp_processor (4.17.0) simplecov (0.21.2) docile (~> 1.1) @@ -464,7 +469,7 @@ GEM uniform_notifier (1.16.0) vcr (5.0.0) version_gem (1.1.3) - web-console (4.2.0) + web-console (4.2.1) actionview (>= 6.0.0) activemodel (>= 6.0.0) bindex (>= 0.4.0) @@ -473,7 +478,7 @@ GEM nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0, < 4.11) - webmock (3.18.1) + webmock (3.19.1) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) @@ -564,6 +569,8 @@ DEPENDENCIES scout_apm secure_headers (~> 6.3) selenium-webdriver + sentry-rails + sentry-ruby spring (~> 4.1) sprockets-rails (= 3.4.2) translation (= 1.37) @@ -578,4 +585,4 @@ RUBY VERSION ruby 3.2.2p53 BUNDLED WITH - 2.4.6 + 2.4.17 diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb new file mode 100644 index 000000000..5199a792d --- /dev/null +++ b/config/initializers/sentry.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +if (dsn = ENV.fetch('SENTRY_DSN', nil)) + Sentry.init do |config| + config.dsn = dsn + config.breadcrumbs_logger = %i[active_support_logger http_logger] + end +end