Class: Rage::Telemetry::Spans::ProcessControllerAction

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

Overview

The controller.action.process span wraps the processing of a controller action.

This span is emitted for every controller action that is executed. See handle for the list of arguments passed to handler methods.

Class Method Summary collapse

Class Method Details

.handle(id:, name:, controller:, request:, response:, 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 "controller.action.process", with: :my_handler

  def my_handler(id:, name:, controller:, request:, response:, env:)
    yield
  end
end

Parameters:

  • id ("controller.action.process")

    ID of the span

  • name (String)

    human-readable name of the operation (e.g., "UsersController#index")

  • controller (RageController::API)

    the controller instance being executed

  • request (Rage::Request)

    the request object associated with the action

  • response (Rage::Response)

    the response object associated with the action

  • env (Hash)

    the Rack environment

Yield Returns:



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

def handle(id:, name:, controller:, request:, response:, env:)
end