open-telemetry/opentelemetry-auto-laravel
Automatic OpenTelemetry instrumentation for Laravel apps. It hooks into the framework to emit traces, metrics, and logs for HTTP requests, database queries, queue jobs, and more, with no manual code changes. Add it to get distributed tracing and observability out of the box.
_register.php hooks discovered by the native opentelemetry PHP extension. That makes it a platform-level runtime dependency, not a normal composer package.opentelemetry extension in the base image, SDK/exporter/auto-laravel packages, OTEL_PHP_AUTOLOAD_ENABLED=true, and OTEL_* variables set in the real process environment rather than .env. A TPM should treat this as a small platform integration project, not a drop-in library. A time-boxed pilot on one non-critical service is appropriate.require-dev produces zero spans and zero errors. Octane/Horizon long-running processes, queue trace propagation, PII/cardinality, and double instrumentation are known sharp edges.OTEL_* variables in php-fpm/Docker/systemd, and validate with the console exporter before connecting a backend. Prove one request trace with HTTP and database child spans. Then add a global middleware for tenant/user attributes and only add custom spans where business logic needs them. For queued jobs, verify parent-child trace continuity; add job middleware to inject/extract context if worker spans are orphaned.composer why-not open-telemetry/opentelemetry-auto-laravel and inspect _register.php hook targets against framework internals. Add CI tests using an in-memory exporter to assert expected span names/attributes. Use OTEL_PHP_DISABLED_INSTRUMENTATIONS to silence noisy instrumentation without code changes. For Octane/Horizon, plan explicit SDK flush rather than relying on auto-shutdown.require-dev; otherwise composer install --no-dev silently removes all traces.OTEL_LOG_LEVEL=debug, and collector logs to separate “not instrumented” from “not exported.”How can I help you explore Laravel packages today?