Skip to content

Commit

Permalink
Merge pull request #236 from ddbj/sentry
Browse files Browse the repository at this point in the history
Setup Sentry
  • Loading branch information
ursm authored Feb 19, 2024
2 parents b3ce76d + d52801c commit 2fa2c7a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 31 deletions.
3 changes: 2 additions & 1 deletion api/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ gem 'rails', '~> 7.1.3'
gem 'aws-sdk-s3'
gem 'base62-rb'
gem 'bootsnap', require: false
gem 'exception_notification'
gem 'faraday'
gem 'faraday-multipart'
gem 'jb'
Expand All @@ -19,6 +18,8 @@ gem 'pg'
gem 'puma'
gem 'rack-cors'
gem 'rambulance'
gem 'sentry-rails'
gem 'sentry-sidekiq'
gem 'sidekiq'
gem 'sidekiq-scheduler'
gem 'submission-excel2xml', github: 'ddbj/submission-excel2xml'
Expand Down
14 changes: 10 additions & 4 deletions api/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ GEM
erubi (1.12.0)
et-orbi (1.2.7)
tzinfo
exception_notification (4.5.0)
actionmailer (>= 5.2, < 8)
activesupport (>= 5.2, < 8)
factory_bot (6.4.5)
activesupport (>= 5.0.0)
factory_bot_rails (6.4.3)
Expand Down Expand Up @@ -331,6 +328,14 @@ GEM
rubyzip (2.3.2)
rufus-scheduler (3.9.1)
fugit (~> 1.1, >= 1.1.6)
sentry-rails (5.16.1)
railties (>= 5.0)
sentry-ruby (~> 5.16.1)
sentry-ruby (5.16.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
sentry-sidekiq (5.16.1)
sentry-ruby (~> 5.16.1)
sidekiq (>= 3.0)
sidekiq (7.2.2)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
Expand Down Expand Up @@ -385,7 +390,6 @@ DEPENDENCIES
bootsnap
climate_control
debug
exception_notification
factory_bot_rails
faraday
faraday-multipart
Expand All @@ -402,6 +406,8 @@ DEPENDENCIES
rambulance
rspec-default_http_header
rspec-rails
sentry-rails
sentry-sidekiq
sidekiq
sidekiq-scheduler
skooma
Expand Down
2 changes: 1 addition & 1 deletion api/config/initializers/error_subscriber.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ErrorSubscriber
def report(error, handled:, severity:, context:, source: nil)
ExceptionNotifier.notify_exception error, data: {handled:, severity:, context:, source:}
Sentry.capture_exception error, extra: {handled:, severity:, context:, source:}
end
end

Expand Down
21 changes: 0 additions & 21 deletions api/config/initializers/exception_notification.rb

This file was deleted.

6 changes: 6 additions & 0 deletions api/config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if dsn = ENV['SENTRY_DSN']
Sentry.init do |config|
config.dsn = dsn
config.breadcrumbs_logger = [:active_support_logger, :http_logger]
end
end
4 changes: 2 additions & 2 deletions compose/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ services:
API_URL:
DATABASE_URL: postgresql://postgres@postgres/ddbj_repository
DDBJ_VALIDATOR_URL: http://host.docker.internal:18840/api
EXCEPTION_RECIPIENTS:
EXCEPTION_SENDER: [email protected]
MINIO_ACCESS_KEY_ID:
MINIO_BUCKET: uploads
MINIO_ENDPOINT:
Expand All @@ -51,6 +49,8 @@ services:
REPOSITORY_DIR: /data/repository
RUBY_YJIT_ENABLE: 'true'
SECRET_KEY_BASE:
SENTRY_CURRENT_ENV:
SENTRY_DSN:
SMTP_ADDRESS:
SMTP_AUTHENTICATION:
SMTP_DOMAIN:
Expand Down
2 changes: 0 additions & 2 deletions compose/local.env
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
API_URL=http://localhost:3000/api
APP_GID=${APP_GID:?}
APP_UID=${APP_UID:?}
EXCEPTION_RECIPIENTS=
EXCEPTION_SENDER=
MINIO_ACCESS_KEY_ID=ddbj-repository
MINIO_ENDPOINT=http://ddbj-repository.localhost:3000
MINIO_ROOT_PASSWORD=minioadmin
Expand Down

0 comments on commit 2fa2c7a

Please sign in to comment.