open-telemetry/opentelemetry
OpenTelemetry PHP metapackage bundling the API and SDK plus common HTTP exporters (OTLP, Zipkin), a PSR-7 factory (nyholm/psr7), and Symfony HTTP client. Great for trying OpenTelemetry; for production, require needed packages directly.
events system).Illuminate\Http\Request, Illuminate\Database).Illuminate\Queue) with minimal configuration.spatie/laravel-psr-middleware).composer.json. Mitigation: Require explicit versions of open-telemetry/opentelemetry-sdk and open-telemetry/opentelemetry-api in production.10% of requests) and disable in non-critical paths.spatie/laravel-activitylog). Mitigation: Use open-telemetry/opentelemetry-php-instrumentation for manual instrumentation or extend via events.Illuminate\Http\Request/Response (via PSR-7 middleware).Illuminate\Database (manual instrumentation or event listeners).Illuminate\Queue (job execution tracing).Illuminate\Events (custom business event tracing).HttpClient (included in the metapackage).HttpTests) for trace verification.composer require open-telemetry/opentelemetry
otel-collector in Docker) or Zipkin.app/Http/Middleware/TracingMiddleware.php).OTEL_TRACES_SAMPLER=parentbased_always_on in dev, OTEL_TRACES_SAMPLER=parentbased_256 in prod).composer.json:
"open-telemetry/opentelemetry-sdk": "^1.0",
"open-telemetry/opentelemetry-api": "^1.0",
"open-telemetry/opentelemetry-exporter-otlp": "^1.0"
json and curl (for OTLP).Illuminate\Database\Events\QueryExecuted.Illuminate\Queue\Jobs\Job execution.open-telemetry/opentelemetry-php-instrumentation).composer why-not to audit updates.config/opentelemetry.php) to avoid hardcoded values.Log::debug("Trace ID: {$traceId}")).otel.exporter.otlp.* metrics.AlwaysOnSampler in dev, ParentBasedSampler in prod) to reduce volume.export_timeout=5s) to minimize overhead.memory_get_usage()) when tracing high-volume endpoints.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| OTLP exporter downtime | Lost traces | Fallback to file-based exporter (ConsoleExporter). |
| High cardinality trace attributes | Backend overload | Sanitize attributes (e.g., mask PII). |
| Sampling misconfiguration | Incomplete observability | Validate sampling rules in staging. |
| Laravel cache clearing | Trace context loss | Store trace IDs in session/cache with TTL. |
| PHP worker crashes | Dropped spans | Use opentelemetry/opentelemetry-php-context for graceful shutdowns. |
otel-collector Docker Compose) and alerting rules.LaravelJob).How can I help you explore Laravel packages today?