opentelemetry-php icon indicating copy to clipboard operation
opentelemetry-php copied to clipboard

Span Drops in FASTCGI and PHP FPM Setup

Open sibasish31 opened this issue 6 months ago • 5 comments

Image

Frame work - larvel-lumen

I am using auto instrumentation of OpenTel, On local set up it is working fine , but on near prod setup where the application run via PHP FPM the root span is droping .

My suspect it FPM worker is getting killed before the queue is evacuated .

sibasish31 avatar Jun 18 '25 13:06 sibasish31

I don't have any specific experience with that setup, but if you are using the batch span processor (default and recommended) then the root span should be exported along with every other span, assuming your whole application runs in less than the export delay (which from memory defaults to 5 seconds). Can you switch your exporter to console or send to an opentelemetry collector with the debug exporter, so that you can inspect the spans exported from a single request? That will show you if it's missing, and we can further debug from there. We'd expect to see the same trace id for all spans, and a parent span ID from one of the spans being the id of the root span...

brettmc avatar Jun 19 '25 04:06 brettmc

I have this working with php-fpm and have not seen this issue before.

You noted that you are using Laravel Lumen, is this correct? (Are you using new999day/opentelemetry-auto-lumen?)

ChrisLightfootWild avatar Jun 25 '25 07:06 ChrisLightfootWild

Yes @ChrisLightfootWild using Laravel Lumen with Php-FPM and Ngnix .

sibasish31 avatar Jun 26 '25 04:06 sibasish31

Yes @ChrisLightfootWild using Laravel Lumen with Php-FPM and Ngnix .

There is no contrib package under open-telemetry which supports Lumen, so which is it that you are using?

The best way forward was still what Brett suggested above, to have the trace export to console and inspect from there.

ChrisLightfootWild avatar Jun 26 '25 15:06 ChrisLightfootWild

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Oct 18 '25 05:10 stale[bot]