softspring/google-cloud-trace-bundle
A Symfony bundle that integrates Google Cloud Trace, adding distributed tracing to your PHP applications. It captures request spans and exports timing data to Google Cloud, helping you monitor latency, diagnose bottlenecks, and follow requests across services.
Architecture fit. This is a Symfony bundle, not a Laravel package — that single fact governs the whole evaluation. It ships DI compiler passes, a Bundle class, and a kernel request listener; Laravel offers no equivalent extension point, so composer require succeeds and php artisan package:discover finds nothing to boot. As a TPM, treat the deliverable as capability transfer, not dependency adoption: the tracing logic (inbound X-Cloud-Trace-Context parsing, sampling, span export to the Cloud Trace API) is portable, the wiring is not. For a Symfony service the fit is native and cheap. For a Laravel estate the realistic options are a thin wrapper over google/cloud-trace, an OpenTelemetry + GCP exporter stack, or using this repo as a reference implementation. Recommend OTel as the default unless the target is Symfony.
Integration feasibility. Low effort on Symfony; moderate-to-high on Laravel with a permanent translation layer owned by us. There is no Laravel service provider, facade, or publishable config, so any plan assuming "drop-in" is wrong and should be corrected in the ticket. The authoritative spec is DependencyInjection/Configuration.php, not the README — that is where project id, sampler, enabled flags, and HTTP-client instrumentation are actually defined.
Technical risk.
Key questions. What changed in the 5.5.10→5.6.0 diff — config keys, service IDs, minimum PHP/Symfony? Is there a stated 5.x support window? Is upstream's recommended path now OpenTelemetry? Who consumes this in production today? Does AGPL-3.0 clear our legal bar for a service-side dependency?
Stack fit. Symfony: proceed, the bundle does what bundles are for and is cheaper than hand-rolling listeners plus exporter lifecycle. Laravel: do not install the bundle. Bind the tracer as a singleton in a TraceServiceProvider guarded on GOOGLE_CLOUD_PROJECT being set and APP_ENV not being local/testing, add a global middleware opening a root span from the inbound header and closing it in terminate(), and register a Guzzle/Http::withMiddleware hook injecting the outbound trace header. That outbound propagation is the highest day-to-day-value piece — it is what makes cross-service traces stitch together.
Migration path. Greenfield; nothing to migrate. That makes this the cheapest moment to pick the right abstraction. Choosing OTel now avoids a second migration later; choosing the Symfony bundle now locks in a framework boundary. Carry the trace header in queue job payloads via job middleware — the bundle does not address async work at all.
Compatibility. Pin and test the full GCP dependency set together. The transitive google/cloud-trace client is the likely conflict point with Pub/Sub, Storage, and Logging in the same process; do not let Composer resolve these independently. Verify the PHP floor and Symfony component constraints against our current LTS.
Sequencing.
Tests/ fixtures before writing the provider.Maintenance. Single-maintainer, small-audience project; releases are cut but release communication is thin. Budget for reading diffs on every bump rather than trusting notes. Expect to carry our own patches — the mitigating factor is that the surface area is small, so forking or vendoring is viable.
Support. No vendor support and unknown upstream response time. Our stated fallback for an unfixed defect is fork-or-vendor; that needs to be a real, resourced option before adoption, not a hypothetical.
Scaling. Tracing volume, not request throughput, is the constraint. Exporting every span at high QPS is both latency and billing cost — set sampling intentionally at rollout and never inherit a 1.0 default. Watch batch export against the PHP-FPM lifecycle: short-lived requests can exit before flush, silently dropping spans; flush during terminate() and accept the tail-latency cost, or accept the loss. Measure request overhead with and without the instrumentation before committing to a rollout.
Failure modes.
GOOGLE_APPLICATION_CREDENTIALS locally). Failures are silent: missing traces, not exceptions.X-Cloud-Trace-Context — untrusted inbound input must not crash the request.Ramp-up. Symfony engineer fluent in the framework: under a day, mostly GCP IAM and getting spans to appear. Laravel team building the wrapper: one to two weeks including propagation testing and failure-mode hardening. On-call engineer debugging a tracing incident cold: this is the real risk — failures surface as either nothing (quiet loss) or unexplained latency, neither intuitive. Write the runbook and the "alert on missing spans" check before rollout, not after.
Recommendation. Do not adopt this release as a Laravel dependency. If the target is Symfony, proceed through the sequencing above with a pinned version and diff review each bump. If the target is Laravel, treat the repo as a specification, adopt OpenTelemetry with the GCP exporter, and gate any bespoke wrapper behind the one-sprint timebox.
How can I help you explore Laravel packages today?