Sha256: 32e179c8f7eaac02ce44516090e68fcf506c2047b40c060eeb48566e4d7191af

Contents?: true

Size: 1.11 KB

Versions: 28

Compression:

Stored size: 1.11 KB

Contents

# frozen_string_literal: true

module Appsignal
  module Integrations
    # @api private
    module ActionCableIntegration
      def perform_action(*args, &block)
        # The request is only the original websocket request
        env = connection.env
        request = ActionDispatch::Request.new(env)
        request_id = request.request_id || SecureRandom.uuid
        env[Appsignal::Hooks::ActionCableHook::REQUEST_ID] ||= request_id

        transaction = Appsignal::Transaction.create(Appsignal::Transaction::ACTION_CABLE)

        begin
          super
        rescue Exception => exception # rubocop:disable Lint/RescueException
          transaction.set_error(exception)
          raise exception
        ensure
          transaction.set_action_if_nil("#{self.class}##{args.first["action"]}")
          transaction.add_params_if_nil(args.first)
          transaction.set_metadata("path", request.path)
          transaction.set_metadata("method", "websocket")
          transaction.add_tags(:request_id => request_id) if request_id
          Appsignal::Transaction.complete_current!
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
appsignal-4.1.1-java lib/appsignal/integrations/action_cable.rb
appsignal-4.1.1 lib/appsignal/integrations/action_cable.rb
appsignal-4.1.0-java lib/appsignal/integrations/action_cable.rb
appsignal-4.1.0 lib/appsignal/integrations/action_cable.rb
appsignal-4.0.9-java lib/appsignal/integrations/action_cable.rb
appsignal-4.0.9 lib/appsignal/integrations/action_cable.rb
appsignal-4.0.8-java lib/appsignal/integrations/action_cable.rb
appsignal-4.0.8 lib/appsignal/integrations/action_cable.rb
appsignal-4.0.7-java lib/appsignal/integrations/action_cable.rb
appsignal-4.0.7 lib/appsignal/integrations/action_cable.rb
appsignal-4.0.6-java lib/appsignal/integrations/action_cable.rb
appsignal-4.0.6 lib/appsignal/integrations/action_cable.rb
appsignal-4.0.5-java lib/appsignal/integrations/action_cable.rb
appsignal-4.0.5 lib/appsignal/integrations/action_cable.rb
appsignal-4.0.4-java lib/appsignal/integrations/action_cable.rb
appsignal-4.0.4 lib/appsignal/integrations/action_cable.rb
appsignal-4.0.3-java lib/appsignal/integrations/action_cable.rb
appsignal-4.0.3 lib/appsignal/integrations/action_cable.rb
appsignal-4.0.2-java lib/appsignal/integrations/action_cable.rb
appsignal-4.0.2 lib/appsignal/integrations/action_cable.rb