Sha256: 8cf41714e99815e7ba193211d06a0c0691261f8c8a07bf86575013e837a3b7c4

Contents?: true

Size: 458 Bytes

Versions: 16

Compression:

Stored size: 458 Bytes

Contents

module Appsignal
  module Middleware
    class ActionViewSanitizer
      TARGET_EVENT_CATEGORY = 'action_view'.freeze

      def call(event)
        if event.name.end_with?(TARGET_EVENT_CATEGORY)
          identifier = event.payload[:identifier]
          if identifier
            identifier.gsub!(root_path, '')
          end
        end
        yield
      end

      def root_path
        @root_path ||= "#{Rails.root.to_s}/"
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
appsignal-0.6.7 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.6 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.5 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.4 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.3 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.3.beta.3 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.3.beta.2 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.3.beta.1 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.2 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.1 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.0.beta.2 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.6.0.beta.1 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.5.5 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.5.3 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.5.1 lib/appsignal/middleware/action_view_sanitizer.rb
appsignal-0.5.0 lib/appsignal/middleware/action_view_sanitizer.rb