Download the PHP package iazaran/trace-replay without Composer

On this page you can find all versions of the php package iazaran/trace-replay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package trace-replay

TraceReplay

Production-conscious step-level tracing, deterministic HTTP replay, and AI-ready debugging for Laravel.

Latest Version PHP Laravel Tests Code Analysis

TraceReplay is not a standard error logger. It is a full-fledged execution tracer that captures every step of your complex workflows, reconstructs them with a waterfall timeline, and offers one-click AI debugging when things go wrong.


Why TraceReplay?


✨ Key Features

Feature TraceReplay Telescope Debugbar Clockwork
Manual step instrumentation
Waterfall timeline UI
Deterministic HTTP replay
Visual JSON diff on replay
AI fix-prompt generator
OpenAI / Anthropic / Ollama
Cache & HTTP tracking
Mail & Notification tracking
DB query tracking per step
Memory tracking per step
Peak memory tracking
Livewire Hydrate Tracing
PII / sensitive-field masking
Queue-job auto-tracing
Artisan-command auto-tracing
Probabilistic Sampling
Dashboard auth & Gate gate N/A
Multi-tenant scoping
W3C Traceparent support
Octane Compatible

🛠 Installation

Quick install:

Or publish the config manually:

Run migrations:

Note: Migrations run automatically without publishing. They use json columns and decimal precision for timings, compatible with MySQL 5.7+, MariaDB, PostgreSQL, and SQLite.

⚠️ Important When Updating: Package migrations do not execute automatically upon composer update. Whenever you update TraceReplay to a newer version, you must run php artisan migrate to ensure any newly introduced schema changes are applied. Review UPGRADE.md for behavioral changes between versions, especially around replay safety, job payload capture, and workspace ID scoping.

Publishing Views

To customize the dashboard UI:

This copies the Blade templates to resources/views/vendor/trace-replay/ where you can customize the layout, colors, or add your own branding.

Recommended: Enable HTTP Middleware

To automatically trace all HTTP requests, add the TraceMiddleware to your application. This provides instant visibility into every request without manual instrumentation.

For Laravel 10 (app/Http/Kernel.php):

For Laravel 11+ (bootstrap/app.php):


⚙️ Configuration

Open config/trace-replay.php. Key options include:

For low-cost production servers, start with sampling instead of tracing every request:

Laravel 11+ applications do not always define an api middleware group. If your app does not, replace trace-replay.api.middleware with middleware that exists in your project, such as ['throttle:api'].


🚀 Usage

Manual Instrumentation

Wrap any complex logic in TraceReplay::step() — each callback's return value is passed through transparently.

API Reference:

Method Description
TraceReplay::start(name, tags[]) Start a new trace; returns Trace or null if disabled/sampled-out
TraceReplay::step(label, callable, extra[]) Wrap callable, record timing, memory, DB queries, errors
TraceReplay::measure(label, callable) Alias for step() — semantic clarity for benchmarks
TraceReplay::checkpoint(label, state[]) Record a zero-overhead breadcrumb (no callable)
TraceReplay::context(array) Merge data into the next step's state_snapshot
TraceReplay::end(status) Finalise trace; status: success or error
TraceReplay::getCurrentTrace() Returns the active Trace model (or null)
TraceReplay::setWorkspaceId(id) Scope subsequent traces to a workspace
TraceReplay::setProjectId(id) Scope subsequent traces to a project

Testing Helper

Use TraceReplay::fake() to verify your instrumentation in tests without hitting the database:

Available assertions:

Assertion Description
assertTraceStarted(name) Assert a trace with the given name was started
assertNoTraceStarted() Assert no trace was started at all
assertTraceCount(n) Assert exactly n traces were started
assertStepRecorded(label) Assert a step with the given label was recorded
assertCheckpointRecorded(label) Assert a checkpoint with the given label was recorded
assertStepCount(n, traceName?) Assert exactly n steps in total (or in a named trace)
assertTraceEnded(status) Assert a trace with the given final status exists

Auto Queue-Job Tracing

Queue jobs are automatically traced when auto_trace.jobs is enabled (default: true). No manual listener registration is needed — the service provider wires everything up.

To disable, set TRACE_REPLAY_AUTO_TRACE_JOBS=false in your .env.

Job payloads are not captured by default because queue payloads often contain sensitive application data. To opt in:


Auto Artisan-Command Tracing

Artisan commands can be auto-traced by enabling auto_trace.commands:

Internal commands like queue:work, horizon, and trace-replay:prune are excluded by default (see auto_trace.exclude_commands in the config).


Debug Bar Component

Drop the <x-trace-replay-trace-bar /> Blade component into your layout for instant in-page trace inspection:


🎨 The Dashboard

Access the built-in dashboard at https://your-app.com/trace-replay.

Features:

Securing the Dashboard

Add authentication or authorization middleware in config/trace-replay.php:

Then define the gate:

Or use IP allowlisting (exact match, comma-separated via env):


Replay Safety

HTTP replay is intentionally conservative:


Failure Notifications

When trace-replay.notifications.on_failure is enabled, mail/Slack notifications are dispatched through a queued job after the response so slow webhooks do not add latency to failed requests.


🤖 AI Debugging

For any failed trace the dashboard shows an AI Fix Prompt button that generates a structured markdown prompt including:

No API Key Required

The AI prompt feature works without any API key. Copy the generated prompt and paste it into ChatGPT, Claude, or any other AI assistant.

Optional: Direct AI Integration

For a seamless experience, configure an AI driver to get answers directly in the dashboard:

With a key configured, clicking "Ask AI" sends the prompt to your chosen AI provider and displays the response in the dashboard.


🤖 MCP / AI-Agent JSON-RPC API

TraceReplay exposes a JSON-RPC 2.0 endpoint at POST /api/trace-replay/mcp for autonomous AI agents.

The API is disabled until TRACE_REPLAY_API_TOKEN is configured. Send requests with:

Available methods:

Method Params Returns
list_traces limit, status, filter_by_error Paginated trace summaries
get_trace_context trace_id, step_limit Trace context with capped steps
generate_fix_prompt trace_id Markdown debugging prompt
trigger_replay trace_id Replay result + JSON diff

Example request:

step_limit defaults to trace-replay.api.max_steps (500) and is capped at that value to keep large traces from producing oversized API responses.


🧹 Data Retention

Automatically prune old traces with the built-in Artisan command. Add to your scheduler:

Options:

Set TRACE_REPLAY_RETENTION_DAYS to choose the default window. If retention_days is null, the prune command exits without deleting data unless --days is passed.


🩺 Diagnostics

Check production-readiness settings with:

The command reports dashboard protection, API token status, sample rate, retention, replay safety, query binding capture, and whether the trace tables exist.


📤 Export

Export a trace to JSON or CSV for archiving or external analysis:


🧪 Testing

The test suite covers:


🛡️ License

The MIT License (MIT). See LICENSE for details.


All versions of trace-replay with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package iazaran/trace-replay contains the following files

Loading the files please wait ...