microsoft/application-insights
Send PHP telemetry (events, traces, exceptions, metrics) to Azure Application Insights for monitoring and diagnostics. Install via Composer and use the SDK to report app performance and availability data to the Azure Portal. Community SDK; not Microsoft-supported.
Pros:
flush()), reducing overhead in high-traffic Laravel apps.Cons:
spatie/laravel-activitylog).Illuminate\Http\Request in trackRequest() for end-to-end tracing.App\Exceptions\Handler) to auto-track errors.flush() in job completion hooks or queue workers.DB::query() in trackDependency()).Illuminate\Auth\Events\Login) to track business events.flush() calls or large telemetry batches could impact Laravel’s response times.flush() calls may cause latency in high-throughput apps.flush() calls? Can async workers (e.g., Laravel queues) offload telemetry?order.created).flush() to Laravel queues for async telemetry.| Laravel Component | Integration Feasibility | Workaround Needed |
|---|---|---|
| HTTP Requests | High (via middleware) | Wrap Illuminate\Http\Request in trackRequest |
| Exceptions | High (exception handler) | Extend App\Exceptions\Handler |
| Eloquent Queries | Medium | Use query observers or wrap DB::query() |
| Queues (Jobs) | Medium | Call flush() in job completion |
| Events | High | Listen to Laravel events |
| API Routes | High | Use route middleware |
| WebSockets (Echo) | Low | Manual instrumentation required |
| Horizon (Queue Workers) | Low | Custom worker monitoring |
config/app.php.bootstrap/app.php or a custom provider.flush().flush() calls (e.g., via flushQueue job).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Azure API Outage | Telemetry loss | Local buffering + retry logic |
| PHP Version Incompatibility | Runtime errors | Downgrade PHP or fork the package |
| Instrumentation Key Invalid | No telemetry sent | Validate key in config + health checks |
| Large Telemetry Batches | Slow flush() calls |
Reduce batch size or use async workers |
| Dependency Updates Break Compatibility | App crashes | Test in staging; pin Composer versions |
How can I help you explore Laravel packages today?