OpenTelemetry Laravel Auto-Instrumentation not working with octane/frankenphp/swoole
Describe your environment Describe any aspect of your environment relevant to the problem, including your php version (php -v will tell you your current version), version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on master.
PHP: 8.2.26 and 8.3.14
Laravel Framework: 11.41.3
Packages:
"open-telemetry/exporter-otlp": "^1.2",
"open-telemetry/opentelemetry-auto-laravel": "^1.0",
"open-telemetry/opentelemetry-auto-psr18": "^1.0",
"open-telemetry/sdk": "^1.2"
Steps to reproduce Describe exactly how to reproduce the error. Include a code sample if applicable.
- Bootstrap a new project (
laravel new) - Install octane
php artisan octane:install --server=frankenphp
# alternatively --server=swoole
- Install opentelemetry dependencies
composer require \
open-telemetry/sdk \
open-telemetry/exporter-otlp \
open-telemetry/opentelemetry-auto-laravel \
open-telemetry/opentelemetry-auto-psr18
- Add environment variables, changed to console trace output for debugging
- Run service:
php artisan octane:frankenphp
What is the expected behavior? What did you expect to see?
- See traces on stdout
What is the actual behavior? What did you see instead?
- Don't see traces on stdout
Additional context Add any other context about the problem here
Tried the same with php artisan serve (so without octane) and this works. Instrumented the same application with the Sentry SDK instead and was able to get traces there.
want to try opentelemetry with laravel octane on swoole, interested is it ready for production?
I am also looking for a solution to this. Running Franken only fires trace for the php artisan octane (on startup).
I've tried using direct trace to Elastic/New Relic, and alternatively, using a local collector. In all scenarios, Octane/Franken was unable to send the data.
Without ZTS you should be able to run New Relic/Elastic APM Agents (or similar) but the performance hit is insane and you need to build following docs.
It looks like this doesn't work with Frankenphp because of the way that it spawns a separate process here, without inheriting any OTEL_* environment vars.
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.
I'd need to test this theory at some point, but I believe we could hook the Process and inject available OTEL env vars.
This issue has been automatically closed because it has not had recent activity, but it can be reopened. Thank you for your contributions.