inspector-apm/inspector-php
Inspector APM PHP agent: instrument your Laravel/PHP apps to collect traces, transactions, errors, and performance metrics. Lightweight integration, configurable sampling and context, helps you find slow requests and production issues fast.
Inspector::middleware()) simplify adoption.Inspector::middleware() in app/Http/Kernel.php for automatic request tracing.Inspector::span() for ORM queries.Inspector::job() for async workflow visibility.Inspector::span('business_logic', fn() => $service->execute())).composer.json constraints).pcntl for async workers (if using queues). No other strict dependencies.| Step | Action | Owner | Dependencies |
|---|---|---|---|
| 1. Setup | Install package, configure .env (API key). |
DevOps/Backend | Inspector account |
| 2. Core Tracing | Add middleware, validate request traces in dashboard. | Backend | Laravel routes |
| 3. Business Logic | Instrument key services/jobs with custom spans. | Backend | Feature parity tests |
| 4. Alerts | Configure SLOs (e.g., error budget, latency). | SRE | Metrics stability |
| 5. Optimization | Adjust sampling, exclude noise. | Backend/SRE | Usage analytics |
inspector-apm/inspector-php for breaking changes (semver-compliant).config/inspector.php) to avoid hardcoding./products/:id if id has low reuse.traceparent headers.| Scenario | Impact | Mitigation Strategy |
|---|---|---|
| Inspector API downtime | No new traces/metrics. | Cache metrics locally; fallback alerts. |
| Agent crash (agent mode) | Data loss for unflushed spans. | Set short flush intervals (e.g., 1s). |
| High cardinality traces | Dashboard overload. | Implement sampling rules. |
| PHP version incompatibility | Package fails to load. | Pin PHP version in composer.json. |
| Network partition (agent) | Traces lost during outages. | Use pure-PHP mode or local buffer fallback. |
Inspector::span() usage and Laravel hooks.How can I help you explore Laravel packages today?