- How does TraceReplay differ from Laravel Telescope or Clockwork for debugging?
- TraceReplay goes beyond traditional debugging tools by offering deterministic HTTP replay, AI-assisted fix prompts, and granular step-level tracking (including jobs, mail, and cache). While Telescope and Clockwork focus on logs and requests, TraceReplay reconstructs *entire workflows* with visual timelines and JSON diffs for precise issue resolution.
- Can I use TraceReplay in Laravel 10/11/12/13 without breaking changes?
- Yes, TraceReplay is fully compatible with Laravel 10–13 and follows Laravel’s semantic versioning. The package uses middleware and service providers that integrate seamlessly with modern Laravel stacks, including Octane. Always test in staging first, as third-party LLM dependencies (e.g., OpenAI) may require API key updates.
- Will TraceReplay slow down high-traffic Laravel APIs (e.g., 1K+ RPS)?
- TraceReplay includes probabilistic sampling to reduce overhead, but full-stack instrumentation (DB, HTTP, cache) may impact latency in high-QPS endpoints. For performance-critical paths, enable sampling or limit tracing to specific middleware/queues. Benchmark in staging before production deployment.
- How do I set up deterministic HTTP replay for API debugging?
- TraceReplay auto-captures HTTP requests and responses. To replay, navigate to the trace in the dashboard, click ‘Replay,’ and use the JSON diff tool to compare states. For non-deterministic data (e.g., UUIDs), manually mask sensitive fields in the config or use the `trace-replay:mask` command.
- Does TraceReplay support multi-tenant Laravel apps with shared databases?
- Yes, TraceReplay includes multi-tenant scoping via middleware or model observers. Configure tenant IDs in the `config/trace-replay.php` file, and traces will automatically isolate by tenant. This works alongside Laravel’s built-in multi-tenancy patterns (e.g., `tenant()` helper).
- How do I enable AI debugging with OpenAI/Anthropic/Ollama?
- Add your API keys to `.env` (`TRACE_REPLAY_AI_KEY=...`) and set the provider in the config. For Ollama (self-hosted), specify the endpoint. AI prompts are generated per trace and can be cached to reduce costs. Start with a budget limit in the config to avoid unexpected charges.
- What’s the best way to handle PII or sensitive data in traces?
- TraceReplay automatically masks PII via regex patterns (e.g., emails, phone numbers) defined in the config. For custom fields, use the `trace-replay:mask` artisan command or middleware. Traces are encrypted in transit (HTTPS) and at rest if your DB supports it (e.g., PostgreSQL’s pgcrypto).
- Can I integrate TraceReplay with Laravel Horizon for queue debugging?
- Absolutely. TraceReplay auto-instruments queue jobs and commands. To correlate traces with Horizon, use the `trace-replay:link-job` command or middleware. The dashboard shows job execution steps alongside HTTP requests, making it easy to debug async failures end-to-end.
- How do I prune old traces to avoid database bloat?
- Use the `trace-replay:prune` artisan command with `--days` or `--count` flags to retain only recent traces. Configure retention policies in the config (e.g., 30 days for production). For high-volume apps, enable sampling (e.g., 1% of requests) to balance storage and debugging needs.
- Are there alternatives to TraceReplay for Laravel debugging?
- For basic debugging, Laravel Telescope or Clockwork suffice, but they lack replay and AI features. For enterprise-grade tracing, consider Xdebug + QCacheGrind (manual) or commercial tools like Sentry (limited replay). TraceReplay uniquely combines deterministic replay, AI prompts, and Laravel-native instrumentation in one package.