# add the resolved controller and action to the trace module Caliper module Rails module AppendInfo extend ActiveSupport::Concern included do before_filter :add_request_info_to_tracer end def add_request_info_to_tracer return true unless env['caliper.tracer'] # elegantly fail if something went wrong with middleware and also when errors are handled request.env["caliper.tracer"].reqs = "#{params[:controller]}##{params[:action]}" # check if developer has added customer data if defined? self.add_to_caliper_trace request.env["caliper.tracer"].add_to_trace(self.add_to_caliper_trace) end # TODO: add other parameters for the trace? end end end end