Class: Rage::Telemetry::Spans::EnqueueDeferredTask

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

Overview

The deferred.task.enqueue span tracks the enqueuing of a deferred task.

This span is triggered when a deferred task is enqueued. See handle for the list of arguments passed to handler methods.

Class Method Summary collapse

Class Method Details

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

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

Parameters:

  • id ("deferred.task.enqueue")

    ID of the span

  • name (String)

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

  • task_class (Class)

    the deferred task being enqueued

  • 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:



17
18
# File 'lib/rage/telemetry/spans/enqueue_deferred_task.rb', line 17

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