module Hoodoo::Monkey::Patch::NewRelicMiddlewareAnalytics::InstanceExtensions

Instance methods to patch over Hoodoo::Services::Middleware.

Public Instance Methods

monkey_log_inbound_request( interaction ) click to toggle source

Add custom attributes to the NewRelic transaction. The original implementation is called via super.

interaction

Hoodoo::Services::Middleware::Interaction instance describing the inbound request. The interaction_id, rack_request and session data is used (the latter being optional). If target_interface and requested_action are available, body data might be logged according to secure log settings in the interface; if these values are unset, body data is not logged.

Calls superclass method
# File lib/hoodoo/monkey/patch/newrelic_middleware_analytics.rb, line 71
def monkey_log_inbound_request( interaction )

  # Add custom attributes to the NewRelic transaction.
  #
  ::NewRelic::Agent.add_custom_attributes(
    {
      :target_action => interaction.requested_action,
      :target_path   => CGI.unescape( interaction.rack_request.path() )
    }
  )

  # Call the original logging method.
  #
  super( interaction )

end