Class: Rage::Telemetry::Spans::ProcessEventSubscriber

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

Overview

The events.subscriber.process span tracks the processing of an event by a subscriber.

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

Class Method Summary collapse

Class Method Details

.handle(id:, name:, subscriber:, event:, 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 "events.subscriber.process", with: :my_handler

  def my_handler(id:, name:, subscriber:, event:, context:)
    yield
  end
end

Parameters:

  • id ("events.subscriber.process")

    ID of the span

  • name (String)

    human-readable name of the operation (e.g., UpdateRecommendations#call)

  • subscriber (Rage::Events::Subscriber)

    the subscriber instance processing the event

  • event (Object)

    the event being processed

  • context (Object, nil)

    the additional context passed along with the event

Yield Returns:



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

def handle(id:, name:, subscriber:, event:, context:)
end