What additional steps need to be performed for Laravel?

I recently installed a dockerized Laravel application. I followed the instructions as mentioned here: apm-agent-php/setup.asciidoc at main · elastic/apm-agent-php · GitHub inside my Docker container. My container is using Ubuntu while my host machine is Windows.

Somehow, requests made to my Laravel application from my browser (accessed from my host machine) are not getting recorded in my Elastic Cloud APM instance. I would like to notify you that Transactions are getting recorded if I run any Command from the CLI of my container. For example, if run php artisan config:clear, then the info is accurately recorded in my Cloud instance:

Am I missing some additional step in order to send Transactional data from Laravel?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Hi Abhishek Sharma,

What version of the agent are you using? It looks like you are using an older version of the APM Agent. Version 1.5.x/16.x onwards also saves the artisan command that is being run. So not only artisan.

PDO/MySQL queries are measured out of the box within the transaction. The handle itself is not processed as a span at this moment unless there is an error. Than the handle() command will be shown in the error with the stack trace.

We currently have auto instrumentation at Laravel for queries, errors, curl commands. We are working on a feature called inferred spans, where more auto instrumentation for slow methods is being traced.

That being said, do you have any output when you set this into a view?

{{ Elastic\Apm\ElasticApm::getCurrentTransaction()->getTraceId() }}

If an error is being shown then the APM Agent is not being triggered. If you a php_info(); file does it show the outputs of the APM agent?