Closed abdelrahmanna closed 1 year ago
@abdelrahmanna what would be the expected behaviour? Return null
if the agent is not enabled?
I think so, since no collectors are present when the agent is disabled the function in the Agent class should not be called so ApmAgent::getCurrentTransaction()
should return null
and ApmAgent::addTraceParentHeader(RequestInterface $request)
sould $request
.
@arkaitzgarro
middleware does not get called when the app is running from console (unite tests/commands), so when the
APM_ACTIVE=false
no transaction will be created which will makeApmAgent::getCurrentTransaction()
always throw an exception.