auxmoney/opentracing-bundle-guzzle
OpentracingBundle to integrate OpenTracing (now OpenTelemetry) with Guzzle HTTP clients, enabling automatic header injection for distributed tracing. This aligns well with Laravel/PHP applications requiring observability across microservices or external API calls.HandlerStack middleware pattern, ensuring minimal performance overhead while maintaining compatibility with existing Guzzle clients (v6/v7).spatie/laravel-symfony-components).HttpClient or Guzzle v6/v7 (Laravel 8+ uses Guzzle v6 by default).spatie/laravel-symfony-components to bridge Symfony bundles.Illuminate\Http\Client).OpentracingBundle (v1+) is required, which may introduce OpenTelemetry compatibility considerations.Http facade integration.OpentracingBundle’s tracer.Http client, queue jobs, or event listeners?Http::get()) calls via Guzzle under the hood.open-telemetry/opentelemetry-php) may reduce Symfony dependency.auxmoney/opentracing-bundle-core (required by this package).symfony/http-client for Guzzle).spatie/laravel-symfony-components.Kernel or service provider:
$this->registerBundle(new \Auxmoney\OpentracingGuzzleBundle\OpentracingGuzzleBundle());
Http client:
// app/Providers/AppServiceProvider.php
use Illuminate\Support\Facades\Http;
use OpenTracing\Span;
Http::macro('withTracing', function () {
return $this->withOptions([
'on_stats' => function (Span $span) { /* ... */ },
]);
});
HandlerStack.bind() methods).laravel-debugbar or tightenco/ziggy to verify tracing headers in responses.curl -v or browser dev tools).OpentracingBundle updates may require bundle version alignment.HandlerStack.OPENTRACING_DEBUG environment variable for verbose tracing logs.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Tracer misconfiguration | No spans recorded | Validate OPENTRACING_* env vars. |
| Guzzle client not decorated | Missing headers in requests | Ensure clients are service-located. |
| Tracing backend unavailable | Spans lost | Implement fallback logging (e.g., Monolog). |
| PHP version mismatch | Bundle fails to load | Pin auxmoney/opentracing-bundle-guzzle:^1.3. |
| Laravel cache clearing | Transient tracing breaks | Use config:clear cautiously. |
How can I help you explore Laravel packages today?