From db2869e366078c223a4857fe0f2d9da0b28ecd78 Mon Sep 17 00:00:00 2001 From: Yusuke Nakamura Date: Mon, 17 Jun 2024 21:01:46 +0900 Subject: [PATCH] Setup sentry --- config/initializers/sentry.rb | 11 +++++++++-- deploy/task_definition.jsonnet | 8 ++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb index 9bf3ca3..56f0134 100644 --- a/config/initializers/sentry.rb +++ b/config/initializers/sentry.rb @@ -1,3 +1,10 @@ -Sentry.init do |config| - config.dsn = ENV['SENTRY_DSN'] +# https://docs.sentry.io/platforms/ruby/guides/rails/ +Sentry.init do |config| + config.dsn = ENV["SENTRY_DSN"] + config.breadcrumbs_logger = [:active_support_logger, :http_logger] + config.environment = ENV.fetch("SENTRY_ENV", Rails.env) + + # To activate performance monitoring, set one of these options. + # We recommend adjusting the value in production: + config.traces_sample_rate = 0.0 end diff --git a/deploy/task_definition.jsonnet b/deploy/task_definition.jsonnet index 75b20f6..98885fb 100644 --- a/deploy/task_definition.jsonnet +++ b/deploy/task_definition.jsonnet @@ -67,6 +67,10 @@ name: 'RAILS_SERVE_STATIC_FILES', value: 'enabled', }, + { + name: 'SENTRY_ENV', + value: 'production', + }, ], secrets: [ { @@ -133,6 +137,10 @@ name: 'SLACK_WEBHOOK_URL', valueFrom: $.parameterStoreArn('SLACK_WEBHOOK_URL'), }, + { + name: 'SENTRY_DSN', + valueFrom: $.parameterStoreArn('SENTRY_DSN'), + }, { name: 'TITO_API_TOKEN', valueFrom: $.parameterStoreArn('TITO_API_TOKEN'),