Class: Rage::Telemetry::Spans::CreateWebsocketConnection

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

Overview

The cable.websocket.handshake span wraps the WebSocket connection handshake process.

This span is started when a WebSocket connection is being established and is finished once the handshake is complete. See handle for the list of arguments passed to handler methods.

Class Method Summary collapse

Class Method Details

.handle(id:, name:, 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.websocket.handshake", with: :my_handler

  def my_handler(id:, name:, env:)
    yield
  end
end

Parameters:

  • id ("cable.websocket.handshake")

    ID of the span

  • name ("WebSocket.handshake")

    human-readable name of the operation

  • env (Hash)

    Rack environment hash that will be attached to the underlying WebSocket connection, allowing you to associate arbitrary data with the connection

Yield Returns:



16
17
# File 'lib/rage/telemetry/spans/create_websocket_connection.rb', line 16

def handle(id:, name:, env:)
end