1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

(feat) sentry error reporting

This commit is contained in:
Sylvain 2023-01-04 16:03:52 +01:00
parent cbb7e8cbcf
commit b6146bad18
7 changed files with 45 additions and 1 deletions

View File

@ -22,6 +22,7 @@
- Active serving static files from the `/public` folder by default from rails
- Display custom error message if the PDF invoice is not found
- Report subsription mismatch with user's group
- Added sentry for error reporting
- Fix a bug: unable to run test in negative timezones (#425)
- Fix a bug: providing an array of attributes to filter OpenApi data, results in error
- Fix a bug: unable to manage stocks on new products

View File

@ -143,3 +143,7 @@ gem 'sassc', '= 2.1.0'
gem 'redis-session-store'
gem 'acts_as_list'
# Error reporting
gem 'sentry-rails'
gem 'sentry-ruby'

View File

@ -397,6 +397,11 @@ GEM
activerecord (>= 4)
activesupport (>= 4)
semantic_range (3.0.0)
sentry-rails (5.7.0)
railties (>= 5.0)
sentry-ruby (~> 5.7.0)
sentry-ruby (5.7.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
sha3 (1.0.1)
shakapacker (6.2.0)
activesupport (>= 5.2)
@ -559,6 +564,8 @@ DEPENDENCIES
rubyzip (>= 1.3.0)
sassc (= 2.1.0)
seed_dump
sentry-rails
sentry-ruby
sha3
shakapacker (= 6.2.0)
sidekiq (>= 6.0.7)
@ -574,4 +581,4 @@ DEPENDENCIES
webmock
BUNDLED WITH
2.3.25
2.3.26

View File

@ -0,0 +1,25 @@
# frozen_string_literal: true
Sentry.init do |config|
config.excluded_exceptions += ['Pundit::NotAuthorizedError']
config.before_send = lambda do |event, hint|
if hint[:exception].is_a?(Redis::CommandError) && hint[:exception].message == 'LOADING Redis is loading the dataset in memory'
nil
else
event
end
end
if ENV.fetch('ENABLE_SENTRY', 'false') == 'true'
config.dsn = 'https://b7dd8812fd0d4d4eac907001e2efec86@o486357.ingest.sentry.io/4504446773886976'
end
config.breadcrumbs_logger = [:active_support_logger]
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production.
config.traces_sample_rate = 0.01
config.environment = Rails.env
end

View File

@ -300,6 +300,11 @@ Accordingly, `RAILS_LOCALE` and `APP_LOCALE` must be configured to `zu`.
NO_COLOR
If set to any value, this will set `config.colorize_logging` to `false`, disabling ANSI color codes when logging information.
<a name="ENABLE_SENTRY"></a>
ENABLE_SENTRY
Sentry is an automated error reporting tool. It is disabled by default, but you can enable it by setting `ENABLE_SENTRY=true`.
<a name="open-projects-settings"></a>
## OpenLab settings
<a name="OPENLAB_BASE_URI"></a>

View File

@ -61,6 +61,7 @@ LOG_LEVEL=debug
RAILS_LOG_TO_STDOUT=true
DISK_SPACE_MB_ALERT=100
ADMINSYS_EMAIL=admin@sleede.com
ENABLE_SENTRY=false
# 5242880 = 5 megabytes
MAX_IMPORT_SIZE=5242880

View File

@ -45,6 +45,7 @@ LOG_LEVEL=debug
DISK_SPACE_MB_ALERT=1024
ADMINSYS_EMAIL=
ALLOW_INSECURE_HTTP=false
ENABLE_SENTRY=false
# 5242880 = 5 megabytes
MAX_IMPORT_SIZE='5242880'