Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenTelemetry Laravel Auto-Instrumentation not working with octane/frankenphp/swoole #1496

Open
thschue opened this issue Jan 31, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@thschue
Copy link

thschue commented Jan 31, 2025

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.

@thschue thschue added the bug Something isn't working label Jan 31, 2025
@kovalovme
Copy link

want to try opentelemetry with laravel octane on swoole, interested is it ready for production?

@alexandrecruz
Copy link

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.

@ChrisLightfootWild
Copy link
Contributor

ChrisLightfootWild commented Feb 8, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants