@@ -452,15 +452,20 @@ def self.completed_span(
452452 attributes = { 'temporalWorkflowID' => Temporalio ::Workflow . info . workflow_id ,
453453 'temporalRunID' => Temporalio ::Workflow . info . run_id } . merge ( attributes )
454454
455- # Create span, which has to be done with illegal call disabling because OTel asks for full exception message
456- # which uses error highlighting and such which accesses File#path
455+ time = Temporalio ::Workflow . now . dup
456+ # Disable illegal call tracing because OTel asks for full exception message which uses error highlighting and
457+ # such which accesses File#path, and they also use loggers accessing current time
457458 Temporalio ::Workflow ::Unsafe . illegal_call_tracing_disabled do
458- time = Temporalio ::Workflow . now . dup
459- span = root . tracer . start_span ( name , attributes :, links :, start_timestamp : time , kind :) # steep:ignore
460- # Record exception if present
461- span . record_exception ( exception ) if exception
462- # Finish the span (returns self)
463- span . finish ( end_timestamp : time )
459+ # Disable durable scheduler because 1) synchronous/non-batch span processors in OTel use network (though
460+ # could have just used Unafe.io_enabled for this if not for the next point) and 2) OTel uses Ruby Timeout
461+ # which we don't want to use durable timers.
462+ Temporalio ::Workflow ::Unsafe . durable_scheduler_disabled do
463+ span = root . tracer . start_span ( name , attributes :, links :, start_timestamp : time , kind :) # steep:ignore
464+ # Record exception if present
465+ span . record_exception ( exception ) if exception
466+ # Finish the span (returns self)
467+ span . finish ( end_timestamp : time )
468+ end
464469 end
465470 end
466471 end
0 commit comments