6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/appsignal/integrations/action_cable.rb', line 6
def perform_action(*args, &block)
env = connection.env
request = ActionDispatch::Request.new(env)
env[Appsignal::Hooks::ActionCableHook::REQUEST_ID] ||=
request.request_id || SecureRandom.uuid
transaction = Appsignal::Transaction.create(
env[Appsignal::Hooks::ActionCableHook::REQUEST_ID],
Appsignal::Transaction::ACTION_CABLE,
request
)
begin
super
rescue Exception => exception transaction.set_error(exception)
raise exception
ensure
transaction.params = args.first
transaction.set_action_if_nil("#{self.class}##{args.first["action"]}")
transaction.set_metadata("path", request.path)
transaction.set_metadata("method", "websocket")
Appsignal::Transaction.complete_current!
end
end
|