mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
Enabled logging to Sentry and patched Ruby logger. Signed-off-by: Juan José Mata <juanjo.mata@gmail.com>
26 lines
836 B
Ruby
26 lines
836 B
Ruby
if ENV["SENTRY_DSN"].present?
|
|
Sentry.init do |config|
|
|
config.dsn = ENV["SENTRY_DSN"]
|
|
config.environment = ENV["RAILS_ENV"]
|
|
config.breadcrumbs_logger = [ :active_support_logger, :http_logger ]
|
|
config.enabled_environments = %w[production]
|
|
|
|
# Enable sending logs to Sentry
|
|
config.enable_logs = true
|
|
# Patch Ruby logger to forward logs
|
|
config.enabled_patches = [ :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.25
|
|
|
|
# Set profiles_sample_rate to profile 100%
|
|
# of sampled transactions.
|
|
# We recommend adjusting this value in production.
|
|
config.profiles_sample_rate = 0.25
|
|
|
|
config.profiler_class = Sentry::Vernier::Profiler
|
|
end
|
|
end
|