Sha256: ed5305499e03ea5aa13dd785c4a9444f4a9c0d048cf14e6148674ddc6547acdf

Contents?: true

Size: 1.11 KB

Versions: 22

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_params_if_nil(args.first)
          transaction.set_action_if_nil("#{self.class}##{args.first["action"]}")
          transaction.set_metadata("path", request.path)
          transaction.set_metadata("method", "websocket")
          transaction.set_tags(:request_id => request_id) if request_id
          Appsignal::Transaction.complete_current!
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
appsignal-3.13.1-java lib/appsignal/integrations/action_cable.rb
appsignal-3.13.1 lib/appsignal/integrations/action_cable.rb
appsignal-3.13.1.alpha.1-java lib/appsignal/integrations/action_cable.rb
appsignal-3.13.1.alpha.1 lib/appsignal/integrations/action_cable.rb
appsignal-3.13.0-java lib/appsignal/integrations/action_cable.rb
appsignal-3.13.0 lib/appsignal/integrations/action_cable.rb
appsignal-3.12.6-java lib/appsignal/integrations/action_cable.rb
appsignal-3.12.6 lib/appsignal/integrations/action_cable.rb
appsignal-3.12.5-java lib/appsignal/integrations/action_cable.rb
appsignal-3.12.5 lib/appsignal/integrations/action_cable.rb
appsignal-3.12.4-java lib/appsignal/integrations/action_cable.rb
appsignal-3.12.4 lib/appsignal/integrations/action_cable.rb
appsignal-3.12.3-java lib/appsignal/integrations/action_cable.rb
appsignal-3.12.3 lib/appsignal/integrations/action_cable.rb
appsignal-3.12.2-java lib/appsignal/integrations/action_cable.rb
appsignal-3.12.2 lib/appsignal/integrations/action_cable.rb
appsignal-3.12.1-java lib/appsignal/integrations/action_cable.rb
appsignal-3.12.1 lib/appsignal/integrations/action_cable.rb
appsignal-3.12.0-java lib/appsignal/integrations/action_cable.rb
appsignal-3.12.0 lib/appsignal/integrations/action_cable.rb