PHPackages                             jobviz/agent - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. jobviz/agent

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

jobviz/agent
============

Lightweight agent SDK for monitoring Laravel Queue, Symfony Messenger, and custom PHP queue jobs with Jobviz

v0.1.0(3mo ago)00MITPHPPHP ^8.1

Since Mar 10Pushed 3mo agoCompare

[ Source](https://github.com/Allbertss/jobviz-agent-php)[ Packagist](https://packagist.org/packages/jobviz/agent)[ Docs](https://jobviz.dev)[ RSS](/packages/jobviz-agent/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (8)Versions (3)Used By (0)

jobviz-agent
============

[](#jobviz-agent)

Lightweight SDK for streaming job lifecycle events from your PHP application to [Jobviz](https://jobviz.dev) — real-time monitoring, alerting, and AI-powered debugging for background jobs.

Supports **Laravel Queue**, **Symfony Messenger**, and custom providers.

Install
-------

[](#install)

```
composer require jobviz/agent
```

Quick Start
-----------

[](#quick-start)

### Laravel (zero-config)

[](#laravel-zero-config)

Add your API key to `.env`:

```
JOBVIZ_API_KEY=your-api-key
```

That's it. The service provider auto-discovers via Composer, hooks into Laravel's queue events, and streams them to Jobviz in batches.

Optionally publish the config file:

```
php artisan vendor:publish --provider="Jobviz\Agent\Laravel\JobvizServiceProvider"
```

### Symfony Messenger

[](#symfony-messenger)

```
use Jobviz\Agent\Config;
use Jobviz\Agent\Jobviz;
use Jobviz\Agent\Providers\SymfonyMessengerProvider;

Jobviz::init(new Config(
    apiKey: $_ENV['JOBVIZ_API_KEY'],
    provider: new SymfonyMessengerProvider(
        dispatcher: $container->get('event_dispatcher'),
    ),
));
```

Register `SymfonyMessengerProvider` as a service to auto-wire it as an event subscriber.

### Multiple queue systems

[](#multiple-queue-systems)

```
use Jobviz\Agent\Config;
use Jobviz\Agent\Jobviz;
use Jobviz\Agent\Providers\MultiProvider;
use Jobviz\Agent\Providers\LaravelQueueProvider;
use Jobviz\Agent\Providers\SymfonyMessengerProvider;

Jobviz::init(new Config(
    apiKey: $_ENV['JOBVIZ_API_KEY'],
    provider: new MultiProvider([
        new LaravelQueueProvider($app['events']),
        new SymfonyMessengerProvider($dispatcher),
    ]),
));
```

In-Job Logging
--------------

[](#in-job-logging)

Attach structured log entries to a running job for step-by-step visibility in the Jobviz timeline:

```
use Jobviz\Agent\Jobviz;

// Inside your job's handle() method
Jobviz::log(
    ['id' => $this->job->getJobId(), 'name' => 'SendEmail', 'queue' => 'emails'],
    'Fetching template',
);

Jobviz::log(
    ['id' => $this->job->getJobId(), 'name' => 'SendEmail', 'queue' => 'emails'],
    'Sending email',
    ['recipients' => count($this->recipients)],
);
```

Deployment Tracking
-------------------

[](#deployment-tracking)

Correlate deployments with job failures in the Jobviz dashboard:

```
use Jobviz\Agent\Jobviz;

Jobviz::trackDeployment(
    version: '1.4.2',
    commitHash: 'abc123f',
    description: 'Fix email retry logic',
);
```

Configuration
-------------

[](#configuration)

OptionTypeDefaultDescription`apiKey``string`*required*Your Jobviz project API key`provider``QueueProviderInterface`*required*Queue provider instance`endpoint``string``https://app.jobviz.dev`Jobviz API endpoint`env``?string``null`Environment tag (e.g. `production`, `staging`)`batchSize``int``100`Max events per HTTP batch`flushInterval``float``3.0`Flush interval in seconds`maxBufferSize``int``10000`Max events buffered in memory before dropping oldest`captureInput``bool``true`Capture job payload data`captureStackTraces``bool``true`Capture stack traces on failure`redactKeys``bool|string[]``true`Redact sensitive keys from job data`debug``bool``false`Enable verbose logging`onError``?Closure``null`Called when a batch fails to send### Laravel config

[](#laravel-config)

When using Laravel, all options are configurable via `config/jobviz.php` and environment variables. See `JOBVIZ_API_KEY`, `JOBVIZ_ENDPOINT`, `JOBVIZ_ENV`, and `JOBVIZ_DEBUG`.

### Internal buffering

[](#internal-buffering)

The event buffer holds up to `maxBufferSize` events (default 10 000) in memory. When the buffer is full, the **oldest events are dropped** to prevent unbounded memory growth.

HTTP transport retries failed requests with exponential backoff (up to 4 attempts) and respects `429 Retry-After` headers.

Privacy &amp; Data Sanitization
-------------------------------

[](#privacy--data-sanitization)

By default, the agent captures job input data and error stack traces — this powers Jobviz's debugging and AI root-cause analysis features.

If your jobs handle sensitive data, you have several levels of control:

```
use Jobviz\Agent\Config;

// 1. Disable input capture entirely
new Config(apiKey: $key, provider: $provider, captureInput: false);

// 2. Disable stack trace capture
new Config(apiKey: $key, provider: $provider, captureStackTraces: false);

// 3. Redact built-in sensitive keys (password, secret, token, etc.)
new Config(apiKey: $key, provider: $provider, redactKeys: true);

// 4. Redact custom keys (merged with built-in set)
new Config(apiKey: $key, provider: $provider, redactKeys: ['ssn', 'dob', 'bankAccount']);

// 5. Disable redaction entirely
new Config(apiKey: $key, provider: $provider, redactKeys: false);
```

Built-in redacted keys: `password`, `secret`, `token`, `apikey`, `api_key`, `authorization`, `creditcard`, `credit_card`, `ssn`, `accesstoken`, `access_token`, `refreshtoken`, `refresh_token`.

Key matching is **case-insensitive** — `Authorization`, `AUTHORIZATION`, and `authorization` are all redacted.

See our [Privacy Policy](https://jobviz.dev/privacy) for full details on data handling.

Multi-Instance Usage
--------------------

[](#multi-instance-usage)

The `Jobviz::init()` / `Jobviz::stop()` helpers manage a global singleton. For advanced use cases (tests, multi-tenant), instantiate `JobvizAgent` directly:

```
use Jobviz\Agent\Config;
use Jobviz\Agent\JobvizAgent;

$agent = new JobvizAgent(new Config(
    apiKey: $_ENV['JOBVIZ_API_KEY'],
    provider: $provider,
));

$agent->start();

// Later...
$agent->stop();
```

Custom Providers
----------------

[](#custom-providers)

Implement the `QueueProviderInterface` to monitor any queue system:

```
use Closure;
use Jobviz\Agent\JobEvent;
use Jobviz\Agent\Providers\QueueProviderInterface;

class MyQueueProvider implements QueueProviderInterface
{
    public function connect(Closure $push): void
    {
        // Subscribe to your queue system and call $push(new JobEvent(...)) for each event
    }

    public function disconnect(): void
    {
        // Clean up connections
    }
}
```

Graceful Shutdown
-----------------

[](#graceful-shutdown)

In Laravel, the service provider automatically flushes remaining events when the application terminates.

For standalone usage, call `stop()` to flush the buffer before your process exits:

```
use Jobviz\Agent\Jobviz;

register_shutdown_function(fn() => Jobviz::stop());
```

> **Tip:** `Jobviz::stop()` disconnects providers and flushes the in-memory buffer — typically under 1 second.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Guzzle HTTP &gt;= 7.0
- One of: Laravel 10+/11+ or Symfony 6+/7+ (or a custom provider)

Documentation
-------------

[](#documentation)

Full documentation is available at [jobviz.dev/docs](https://jobviz.dev/docs).

- [Getting Started](https://jobviz.dev/docs/getting-started)
- [PHP SDK Reference](https://jobviz.dev/docs/php-sdk)
- [Custom Integration](https://jobviz.dev/docs/custom-integration)
- [Examples](https://jobviz.dev/docs/examples)

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance80

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

105d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2142ea83a11ea804b63682e6db8ec6164f9b008ed97da7690caa8e1b8f0dcca3?d=identicon)[Allbertss](/maintainers/Allbertss)

---

Top Contributors

[![Allbertss](https://avatars.githubusercontent.com/u/42111918?v=4)](https://github.com/Allbertss "Allbertss (2 commits)")

---

Tags

symfonylaravelmonitoringqueuejobsobservability

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jobviz-agent/health.svg)

```
[![Health](https://phpackages.com/badges/jobviz-agent/health.svg)](https://phpackages.com/packages/jobviz-agent)
```

###  Alternatives

[storviaio/vantage

Vantage: Strategic queue monitoring and observability for Laravel applications.

25336.8k](/packages/storviaio-vantage)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
