diff --git a/Gemfile b/Gemfile index 5cc81ce7..ee646665 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source 'https://rubygems.org' gem 'bcrypt' gem 'bootstrap-will_paginate' gem 'carrierwave' -gem 'concurrent-ruby' gem 'docker-api', require: 'docker' gem 'factory_bot_rails' gem 'forgery' @@ -12,7 +11,6 @@ gem 'jbuilder' gem 'jquery-rails' gem 'ims-lti', '< 2.0.0' gem 'kramdown' -gem 'newrelic_rpm' gem 'pg' gem 'pry-byebug' gem 'puma' @@ -35,12 +33,17 @@ gem 'nokogiri' gem 'webpacker' gem 'rest-client' gem 'rubyzip' -gem 'mnemosyne-ruby' gem 'faraday' gem 'proforma', git: 'https://github.com/openHPI/proforma.git', tag: 'v0.4' gem 'whenever', require: false gem 'rails-timeago' +# Error Tracing +gem 'concurrent-ruby' +gem 'mnemosyne-ruby' +gem 'newrelic_rpm' +gem 'sentry-raven' + group :development, :staging do gem 'bootsnap', require: false gem 'listen' diff --git a/Gemfile.lock b/Gemfile.lock index 4e8cd7ce..47e8e373 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -151,7 +151,7 @@ GEM factory_bot_rails (5.1.1) factory_bot (~> 5.1.0) railties (>= 4.2.0) - faraday (1.0.0) + faraday (0.17.3) multipart-post (>= 1.2, < 3) faye-websocket (0.10.9) eventmachine (>= 0.12.0) @@ -368,6 +368,8 @@ GEM selenium-webdriver (3.142.7) childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) + sentry-raven (2.13.0) + faraday (>= 0.7.6, < 1.0) shoulda-matchers (4.2.0) activesupport (>= 4.2.0) simplecov (0.17.1) @@ -499,6 +501,7 @@ DEPENDENCIES rubyzip sass-rails selenium-webdriver + sentry-raven shoulda-matchers simplecov slim-rails diff --git a/config/initializers/raven.rb b/config/initializers/raven.rb new file mode 100644 index 00000000..f4323bfd --- /dev/null +++ b/config/initializers/raven.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'concurrent' + +Rails.application.tap do |app| + pool = ::Concurrent::ThreadPoolExecutor.new(max_queue: 10) + + Raven.configure do |config| + config.sanitize_fields = app.config.filter_parameters.map(&:to_s) + + config.async = lambda do |event| + pool.post { ::Raven.send_event(event) } + end + + # Do not sent full list of gems with each event + config.send_modules = false + end +end