Skip to content

Commit

Permalink
Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
Shpigford committed Apr 8, 2024
1 parent 671247f commit 21e2d05
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,9 @@ POSTGRES_USER=postgres
# This is the domain that your Maybe instance will be hosted at. It is used to generate links in emails and other places.
APP_DOMAIN=

## Error and Performance Monitoring
# The app uses Sentry to monitor errors and performance. In reality, you likely don't need this unless you're deploying Maybe to many users.
SENTRY_DSN=

# Used to enable specific features unique to the hosted version of Maybe. There's a very high likelihood that you don't need to change this value.
HOSTED=false
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ gem "good_job"
# Search
gem "ransack"

# Error logging
gem "stackprof"
gem "sentry-ruby"
gem "sentry-rails"

# Other
gem "bcrypt", "~> 3.1.7"
gem "inline_svg"
Expand Down
10 changes: 10 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,15 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
sentry-rails (5.17.2)
railties (>= 5.0)
sentry-ruby (~> 5.17.2)
sentry-ruby (5.17.2)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
smart_properties (1.17.0)
sorbet-runtime (0.5.11332)
stackprof (0.2.26)
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.0)
Expand Down Expand Up @@ -430,6 +437,9 @@ DEPENDENCIES
rubocop-rails-omakase
ruby-lsp-rails
selenium-webdriver
sentry-rails
sentry-ruby
stackprof
stimulus-rails
tailwindcss-rails
turbo-rails
Expand Down
17 changes: 17 additions & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if ENV["SENTRY_DSN"].present?
Sentry.init do |config|
config.dsn = ENV["SENTRY_DSN"]
config.breadcrumbs_logger = [ :active_support_logger, :http_logger ]
config.enabled_environments = %w[production]

# 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 = 1.0

# Set profiles_sample_rate to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
config.profiles_sample_rate = 1.0
end
end

0 comments on commit 21e2d05

Please sign in to comment.