Class: Rage::Telemetry::Spans::ProcessCableAction

Inherits:
Object
  • Object
show all
Defined in:
lib/rage/telemetry/spans/process_cable_action.rb

Overview

The cable.action.process span wraps the processing of a single Rage::Cable channel action.

This span is started just before the action method is invoked on the channel, and is ended immediately after the action method returns. See handle for the list of arguments passed to handler methods.

Class Method Summary collapse

Class Method Details

.handle(id:, name:, channel:, action:, data:, env:) ⇒ Object

Note:

Rage automatically detects which parameters your handler method accepts and only passes those parameters. You can omit any of the parameters described here.

Examples:

class MyTelemetryHandler < Rage::Telemetry::Handler
  handle "cable.action.process", with: :my_handler

  def my_handler(id:, name:, channel:, action:, data:, env:)
    yield
  end
end

Parameters:

  • id ("cable.action.process")

    ID of the span

  • name (String)

    human-readable name of the operation (e.g., ChatChannel#receive)

  • channel (Rage::Cable::Channel)

    the channel instance processing the action

  • action (Symbol)

    the name of the action method being invoked

  • data (Hash, nil)

    the data payload sent with the action

  • env (Hash)

    the Rack environment associated with the WebSocket connection

Yield Returns:



19
20
# File 'lib/rage/telemetry/spans/process_cable_action.rb', line 19

def handle(id:, name:, channel:, action:, data:, env:)
end