Skip to content

Commit

Permalink
feat: sentryを導入
Browse files Browse the repository at this point in the history
sentryはproductionでのみ有効化することを想定しています
環境変数SENTRY_DSNを設定してください
  • Loading branch information
IkumaTadokoro committed Apr 25, 2022
1 parent 1e9b9a4 commit 308cf25
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ gem 'jp_local_gov'
gem 'kaminari'
gem 'meta-tags'
gem 'rails-i18n'
gem 'sentry-ruby'
gem 'sentry-rails'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
Expand Down
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
sentry-rails (5.2.1)
railties (>= 5.0)
sentry-ruby-core (~> 5.2.1)
sentry-ruby (5.2.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
sentry-ruby-core (= 5.2.1)
sentry-ruby-core (5.2.1)
concurrent-ruby
slim (4.1.0)
temple (>= 0.7.6, < 0.9)
tilt (>= 2.0.6, < 2.1)
Expand Down Expand Up @@ -343,6 +351,8 @@ DEPENDENCIES
rubocop-rspec
sass-rails (>= 6)
selenium-webdriver
sentry-rails
sentry-ruby
slim-rails
slim_lint
spring
Expand Down
13 changes: 13 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Sentry.init do |config|
config.dsn = ENV["SENTRY_DSN"]
config.breadcrumbs_logger = [:active_support_logger, :http_logger]

# Set tracesSampleRate to 1.0 to capture 100%
# of transactions for performance monitoring.
# We recommend adjusting this value in production
config.traces_sample_rate = 1.0
# or
config.traces_sampler = lambda do |context|
true
end
end

0 comments on commit 308cf25

Please sign in to comment.