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.9.1-java lib/appsignal/integrations/action_cable.rb
appsignal-3.9.1 lib/appsignal/integrations/action_cable.rb
appsignal-3.9.0-java lib/appsignal/integrations/action_cable.rb
appsignal-3.9.0 lib/appsignal/integrations/action_cable.rb
appsignal-3.8.1-java lib/appsignal/integrations/action_cable.rb
appsignal-3.8.1 lib/appsignal/integrations/action_cable.rb
appsignal-3.8.0-java lib/appsignal/integrations/action_cable.rb
appsignal-3.8.0 lib/appsignal/integrations/action_cable.rb
appsignal-3.7.6-java lib/appsignal/integrations/action_cable.rb
appsignal-3.7.6 lib/appsignal/integrations/action_cable.rb
appsignal-3.7.2-java lib/appsignal/integrations/action_cable.rb
appsignal-3.7.2 lib/appsignal/integrations/action_cable.rb
appsignal-3.7.1-java lib/appsignal/integrations/action_cable.rb
appsignal-3.7.1 lib/appsignal/integrations/action_cable.rb
appsignal-3.7.0-java lib/appsignal/integrations/action_cable.rb
appsignal-3.7.0 lib/appsignal/integrations/action_cable.rb
appsignal-3.6.5-java lib/appsignal/integrations/action_cable.rb
appsignal-3.6.5 lib/appsignal/integrations/action_cable.rb
appsignal-3.6.4-java lib/appsignal/integrations/action_cable.rb
appsignal-3.6.4 lib/appsignal/integrations/action_cable.rb