module Oboe::PadrinoInst::Routing

Public Class Methods

included(klass) click to toggle source
# File lib/oboe/frameworks/padrino.rb, line 7
def self.included(klass)
  ::Oboe::Util.method_alias(klass, :dispatch!, ::Padrino::Routing)
end

Public Instance Methods

dispatch_with_oboe() click to toggle source
# File lib/oboe/frameworks/padrino.rb, line 11
def dispatch_with_oboe
  if Oboe.tracing?
    report_kvs = {}

    # Fall back to the raw tracing API so we can pass KVs
    # back on exit (a limitation of the Oboe::API.trace
    # block method) This removes the need for an info
    # event to send additonal KVs
    ::Oboe::API.log_entry('padrino', {})

    begin
      r = dispatch_without_oboe

      # Report Controller/Action as best possible
      if request.controller and not request.controller.empty?
        report_kvs[:Controller] = request.controller
      else
        report_kvs[:Controller] = self.class
      end

      report_kvs[:Action] = request.action
      r
     ensure
      ::Oboe::API.log_exit('padrino', report_kvs)
     end
  else
    dispatch_without_oboe
  end
end