While most uses may see the Span::start() method, and therefore the Timer::start(), called immediately after the Span is created, that is not required and any amount of time could pass between the events. This could create a situation in which the staring point of the span within the transaction is represented at the wrong starting timestamp.
The
EventBean
class sets thetimestamp
value in it's constructor:https://github.com/nipwaayoni/elastic-apm-php-agent/blob/master/src/Events/EventBean.php#L104
This is inconsistent with derived classes such as
Span
which use aTimer
started after construction to calculate the duration:https://github.com/nipwaayoni/elastic-apm-php-agent/blob/master/src/Events/Span.php#L68
While most uses may see the
Span::start()
method, and therefore theTimer::start()
, called immediately after theSpan
is created, that is not required and any amount of time could pass between the events. This could create a situation in which the staring point of the span within the transaction is represented at the wrong starting timestamp.