Download the PHP package erfanmomeniii/laravel-jaeger-client without Composer
On this page you can find all versions of the php package erfanmomeniii/laravel-jaeger-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download erfanmomeniii/laravel-jaeger-client
More information about erfanmomeniii/laravel-jaeger-client
Files in erfanmomeniii/laravel-jaeger-client
Package laravel-jaeger-client
Short Description A production-grade Jaeger distributed tracing client for Laravel with deep framework integration
License MIT
Informations about the package laravel-jaeger-client
Laravel Jaeger Client
A production-grade Jaeger distributed tracing client for Laravel.
Zero-config automatic tracing for HTTP requests, database queries, queue jobs, cache, Redis, and more — plus a clean API for manual instrumentation.
Why This Package?
| Feature | This package | Raw PHP Jaeger clients | OpenTelemetry SDK |
|---|---|---|---|
| Automatic HTTP tracing | ✅ | ❌ | ✅ |
| DB / Queue / Cache watchers | ✅ | ❌ | Partial |
Jaeger::fake() for testing |
✅ | ❌ | ❌ |
| Trace context in logs | ✅ | ❌ | Partial |
| Zero external PHP deps | ✅ | ❌ | ❌ |
| Lightweight (no gRPC/protobuf) | ✅ | ✅ | ❌ |
| Laravel auto-discovery | ✅ | ❌ | ❌ |
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
ext-sockets(for UDP transport, enabled by default in most PHP installations)
Installation
Publish the config file:
That's it. The package auto-discovers and starts tracing immediately.
Quick Start
1. Start Jaeger
2. Add to your .env
3. Make a request to your app, then open http://localhost:16686
You'll see traces for every HTTP request, including child spans for each database query, outbound HTTP call, and more — without writing a single line of tracing code.
What Gets Traced Automatically
| Component | Span name | Enabled by default |
|---|---|---|
| HTTP requests | HTTP GET /api/users |
✅ |
| Database queries | db.query |
✅ |
| Queue jobs | queue.process ProcessPayment |
✅ |
| Outbound HTTP | HTTP POST api.stripe.com |
✅ |
| Log context | (injects trace_id/span_id) | ✅ |
| Cache operations | cache.hit, cache.put |
❌ |
| Redis commands | redis.GET, redis.SET |
❌ |
| Events | event.OrderCreated |
❌ |
| Artisan commands | artisan:migrate |
❌ |
| View rendering | view.render welcome |
❌ |
Enable any disabled watcher in config/jaeger.php:
Manual Instrumentation
measure() — Trace a block of code (recommended)
The simplest way. The span auto-finishes when the callback returns, and errors are auto-tagged:
jaeger_span() — Quick scope for manual control
When you need to add tags or logs during execution:
Other Helpers
Configuration
All settings are in config/jaeger.php, driven by environment variables:
Core Settings
Transport
Sampling
Propagation Format
Feature Toggles
Queue Tracing
Trace context propagates automatically from the dispatching request to the job worker. Add the TracedJob trait to your jobs:
Log Correlation
When JAEGER_LOG_CONTEXT_ENABLED=true (default), every log line includes trace context:
Search your logs by trace_id to find all log entries for a single request, then click through to the Jaeger UI to see the full trace.
Testing
Jaeger::fake()
Works just like Laravel's Queue::fake() and Event::fake():
WithTracing Trait
For test classes that always need tracing:
All Assertion Methods
| Method | Description |
|---|---|
assertSpanCreated($name) |
A span with this operation name exists |
assertSpanNotCreated($name) |
No span with this name exists |
assertSpanCreatedWithTags($name, $tags) |
Span exists with these tag values |
assertSpanCount($n) |
Exactly n spans were created |
assertNoSpansCreated() |
Zero spans created |
assertSpanHasTag($name, $key, $value) |
Specific tag value on a span |
assertSpanHasLog($name, $fields) |
Span has a log entry with these fields |
collectedSpans() |
Get raw span array for custom assertions |
reset() |
Clear all collected spans |
Extending
Every component is coded to an interface. Swap any part by rebinding in the container.
Custom Sampler
Custom Transport
Resilience
This package is designed to never break your application:
- All watchers and middleware wrap their logic in
try/catch— tracing errors are silently swallowed - UDP transport has a circuit breaker — stops trying after 5 consecutive failures, retries after 30s
- When
JAEGER_ENABLED=false, aNullTraceris used with zero allocations (no performance impact) - Spans have hard limits on tags (256), logs (128), and tag value length (4KB) to prevent memory issues
- Flush happens in
app()->terminating()— after the response is sent to the client
License
MIT — see LICENSE.
All versions of laravel-jaeger-client with dependencies
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/queue Version ^10.0|^11.0|^12.0
illuminate/log Version ^10.0|^11.0|^12.0