lib/sentry/rails/configuration.rb in sentry-rails-5.5.0 vs lib/sentry/rails/configuration.rb in sentry-rails-5.6.0
- old
+ new
@@ -58,13 +58,31 @@
# In those cases, we should skip ActiveJob's reporting to avoid duplicated reports.
attr_accessor :skippable_job_adapters
attr_accessor :tracing_subscribers
+ # sentry-rails by default skips asset request' transactions by checking if the path matches
+ #
+ # ```rb
+ # %r(\A/{0,2}#{::Rails.application.config.assets.prefix})
+ # ```
+ #
+ # If you want to use a different pattern, you can configure the `assets_regexp` option like:
+ #
+ # ```rb
+ # Sentry.init do |config|
+ # config.rails.assets_regexp = /my_regexp/
+ # end
+ # ```
+ attr_accessor :assets_regexp
+
def initialize
@register_error_subscriber = false
@report_rescued_exceptions = true
@skippable_job_adapters = []
+ @assets_regexp = if defined?(::Sprockets::Rails)
+ %r(\A/{0,2}#{::Rails.application.config.assets.prefix})
+ end
@tracing_subscribers = Set.new([
Sentry::Rails::Tracing::ActionControllerSubscriber,
Sentry::Rails::Tracing::ActionViewSubscriber,
Sentry::Rails::Tracing::ActiveRecordSubscriber,
Sentry::Rails::Tracing::ActiveStorageSubscriber