Sha256: 0ca3da3a353791293fc353e42afde43d34cdda81e5a358c26feab0f99d9b8cdd

Contents?: true

Size: 545 Bytes

Versions: 57

Compression:

Stored size: 545 Bytes

Contents

module Appsignal
  class Aggregator
    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
              event.payload[:identifier] = identifier.gsub(root_path, '')
            end
          end
          yield
        end

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

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
appsignal-0.11.18 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.17 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.16 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.15 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.14 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.14.beta.1 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.13 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.13.beta.4 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.13.beta.3 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.13.beta.2 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.13.beta.1 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.13.beta.0 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.12 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.11 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.10 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.10.beta.2 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.10.beta.1 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.9 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.8.beta.4 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb
appsignal-0.11.8.beta.3 lib/appsignal/aggregator/middleware/action_view_sanitizer.rb