Class: Appsignal::Middleware::ActionViewSanitizer

Inherits:
Object
  • Object
show all
Defined in:
lib/appsignal/middleware/action_view_sanitizer.rb

Constant Summary collapse

TARGET_EVENT_CATEGORY =
'action_view'.freeze

Instance Method Summary collapse

Instance Method Details

#call(event) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/appsignal/middleware/action_view_sanitizer.rb', line 6

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

#root_pathObject



16
17
18
# File 'lib/appsignal/middleware/action_view_sanitizer.rb', line 16

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