Sha256: 652a541d2b22579b4194a8a69554a6bff1ca4da9e72520667049e333541778cc

Contents?: true

Size: 1.08 KB

Versions: 184

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

module Appsignal
  module Integrations
    module ActionCableIntegration
      def perform_action(*args, &block)
        # The request is only the original websocket request
        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 # rubocop:disable Lint/RescueException
          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
    end
  end
end

Version data entries

184 entries across 184 versions & 1 rubygems

Version Path
appsignal-3.4.8-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.8 lib/appsignal/integrations/action_cable.rb
appsignal-3.4.7-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.7 lib/appsignal/integrations/action_cable.rb
appsignal-3.4.6-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.6 lib/appsignal/integrations/action_cable.rb
appsignal-3.4.5-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.5 lib/appsignal/integrations/action_cable.rb
appsignal-3.4.4-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.4 lib/appsignal/integrations/action_cable.rb
appsignal-3.4.3-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.3 lib/appsignal/integrations/action_cable.rb
appsignal-3.4.2-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.2 lib/appsignal/integrations/action_cable.rb
appsignal-3.4.1-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.1 lib/appsignal/integrations/action_cable.rb
appsignal-3.4.0-java lib/appsignal/integrations/action_cable.rb
appsignal-3.4.0 lib/appsignal/integrations/action_cable.rb
appsignal-3.3.10-java lib/appsignal/integrations/action_cable.rb
appsignal-3.3.10 lib/appsignal/integrations/action_cable.rb