You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the onEnd methods, spans are pushed to the batch array buffer.
the batch buffer is moved to the queue stack by the enqueueBatch method
the enqueueBatch is called:
when the batch buffer has more than maxExportBatchSize traces
Or when shouldFlush return true and queue is empty => this requires autoFlush + $this->clock->now() > $this->nextScheduledRun
There are cases (less span than maxExportBatchSize and process finish in less than scheduledDelayNanos) Where spans are not moved from batch buffer to queue stack and thus not flushed / exported
possible solution
Adds if ($this->batch !== []) { $this->enqueueBatch();} in shutdown and forceFlush and ask people to call these methods (or call shutdown on __destruct)
The text was updated successfully, but these errors were encountered:
Calling ::shutdown() is necessary and should flush all enqueued spans (::shutdown() adds the current batch id to the $this->flush queue); do you have a reproducer that calls ::shutdown()?
It's important to run the tracer provider's shutdown() method when the PHP process ends, to enable flushing of any enqueued telemetry.
Describe your environment
Since #788 spans are not all flushed.
onEnd
methods, spans are pushed to thebatch
array buffer.batch
buffer is moved to thequeue
stack by theenqueueBatch
methodenqueueBatch
is called:batch
buffer has more thanmaxExportBatchSize
tracesshouldFlush
return true andqueue
is empty => this requiresautoFlush + $this->clock->now() > $this->nextScheduledRun
There are cases (less span than
maxExportBatchSize
and process finish in less thanscheduledDelayNanos
) Where spans are not moved frombatch
buffer toqueue
stack and thus not flushed / exportedpossible solution
Adds
if ($this->batch !== []) { $this->enqueueBatch();}
inshutdown
andforceFlush
and ask people to call these methods (or callshutdown
on__destruct
)The text was updated successfully, but these errors were encountered: