Module: Padrino::Routing::InstanceMethods

Defined in:
lib/appsignal/integrations/padrino.rb

Instance Method Summary collapse

Instance Method Details

#route!(base = settings, pass_block = nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/appsignal/integrations/padrino.rb', line 25

def route!(base = settings, pass_block = nil)
  if !Appsignal.active? || env["sinatra.static_file"]
    return route_without_appsignal(base, pass_block)
  end

  transaction = Appsignal::Transaction.create(
    SecureRandom.uuid,
    Appsignal::Transaction::HTTP_REQUEST,
    request
  )
  begin
    Appsignal.instrument("process_action.padrino") do
      route_without_appsignal(base, pass_block)
    end
  rescue Exception => error # rubocop:disable Lint/RescueException
    transaction.set_error(error)
    raise error
  ensure
    transaction.set_action_if_nil(get_payload_action(request))
    transaction.("path", request.path)
    transaction.("method", request.request_method)
    transaction.set_http_or_background_queue_start
    Appsignal::Transaction.complete_current!
  end
end

#route_without_appsignalObject



23
# File 'lib/appsignal/integrations/padrino.rb', line 23

alias route_without_appsignal route!