module Sashiko::Ractor
Ractor-based parallel execution with span replay.
The problem: OpenTelemetry Ruby cannot emit spans inside a Ractor because its module state carries unshareable instance variables (mutexes, propagation). Upstream OTel has acknowledged this as a blocker for Ractor adoption.
The workaround: inside the Ractor, record spans as plain frozen Data values (no OTel dependency), send them via Ractor::Port to the main Ractor, and replay them there as real OTel spans with their original start/end timestamps and parent linkage.
Caveats: trace_id / span_id are assigned at replay time on the main side; OpenTelemetry::Baggage set inside the Ractor is not propagated out; sampling decisions happen at replay time.