Class: Rage::Telemetry::Spans::ProcessDeferredTask

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

Overview

The deferred.task.process span tracks the processing of a deferred task.

This span is started when a deferred task begins processing and ends when the task has completed processing. See handle for the list of arguments passed to handler methods.

Class Method Summary collapse

Class Method Details

.handle(id:, name:, task:, task_class:, task_context:) ⇒ 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 "deferred.task.process", with: :my_handler

  def my_handler(id:, name:, task:, task_class:, task_context:)
    yield
  end
end

Parameters:

  • id ("deferred.task.process")

    ID of the span

  • name (String)

    human-readable name of the operation (e.g., SendConfirmationEmail#perform)

  • task (Rage::Deferred::Task)

    the deferred task being processed

  • task_class (Class)

    the class of the deferred task being processed

  • task_context (Hash)

    the context is serialized together with the deferred task and allows passing data between telemetry handlers or deferred middleware without exposing it to the task itself

Yield Returns:



18
19
# File 'lib/rage/telemetry/spans/process_deferred_task.rb', line 18

def handle(id:, name:, task:, task_class:, task_context:)
end