Class: OpenTelemetry::Instrumentation::Rage::Handlers::Fiber

Inherits:
Rage::Telemetry::Handler
  • Object
show all
Defined in:
lib/opentelemetry/instrumentation/rage/handlers/fiber.rb

Overview

The class uses Fiber storage to propagate OpenTelemetry context between fibers.

Defined Under Namespace

Modules: Patch

Instance Method Summary collapse

Constructor Details

#initializeFiber

Returns a new instance of Fiber.



22
23
24
25
# File 'lib/opentelemetry/instrumentation/rage/handlers/fiber.rb', line 22

def initialize
  super
  ::Fiber.singleton_class.prepend(Patch)
end

Instance Method Details

#propagate_otel_contextObject



29
30
31
# File 'lib/opentelemetry/instrumentation/rage/handlers/fiber.rb', line 29

def propagate_otel_context(&)
  OpenTelemetry::Context.with_current(::Fiber[:__rage_otel_context], &)
end