Download the PHP package cboxdk/laravel-queue-metrics without Composer

On this page you can find all versions of the php package cboxdk/laravel-queue-metrics. 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 laravel-queue-metrics

Cbox Queue Metrics

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Production-ready queue monitoring and metrics collection for Laravel applications.

Queue Metrics for Laravel provides deep observability into your Laravel queue system with minimal overhead. Track job execution, monitor worker performance, analyze trends, and export to Prometheusβ€”all with zero configuration required.

Why Queue Metrics for Laravel?

Quick Example

Documentation

πŸ“š Full Documentation β†’

πŸš€ Need Deep Insight and Replay Capability?

While this package provides a high-level overview of your queue's health and performance via aggregated metrics, Queue Monitor for Laravel allows you to dive into individual job executions.

We recommend installing it if you need:

The two packages are designed to work together: Metrics tells you that something is wrong, while Monitor tells you what is wrong and lets you fix it.

Getting Started

Integration

Extensibility

Real-World Examples

Installation

That's it! The package auto-registers and starts collecting metrics immediately.

For database storage, run migrations:

β†’ Full installation guide

Key Features

Job Metrics

Track execution time, memory usage, CPU time, throughput, and failure rates per job class with percentile statistics (P50, P95, P99).

Queue Health

Monitor queue depth, processing rates, failure rates, and health scores with automatic issue detection.

Worker Monitoring

Real-time worker status, resource consumption, efficiency metrics, and stale worker detection.

Trend Analysis

Historical analysis with linear regression, forecasting, and anomaly detection for proactive insights.

Baseline Comparison

Automatic baseline calculation to detect performance degradation and regressions.

Flexible Storage

Redis (fast, in-memory) or Database (persistent) backends with automatic TTL cleanup.

Prometheus Export

Native Prometheus metrics endpoint for Grafana dashboards and alerting.

OpenTelemetry via laravel-telemetry

When cboxdk/laravel-telemetry is installed (requires Laravel 12+), queue metrics automatically publishes the state telemetry cannot see on its own β€” no configuration required (disable with QUEUE_METRICS_TELEMETRY_ENABLED=false):

Metric Type Unit Labels
queue_metrics.queue.depth gauge {jobs} connection, queue, state (pending/scheduled/reserved)
queue_metrics.queue.oldest_job.age gauge s connection, queue
queue_metrics.queue.throughput gauge {jobs}/min connection, queue
queue_metrics.queue.failure_rate gauge % connection, queue
queue_metrics.queue.active_workers gauge {workers} connection, queue
queue_metrics.queue.health_score gauge 1 connection, queue
queue_metrics.workers.count gauge {workers} state (busy/idle)
queue_metrics.workers.utilization gauge % window (current/lifetime)
queue_metrics.workers.efficiency gauge % β€”
queue_metrics.baseline.duration gauge ms connection, queue
queue_metrics.baseline.memory gauge MBy connection, queue
queue_metrics.baseline.cpu gauge % connection, queue
queue_metrics.baseline.confidence gauge 1 connection, queue
queue_metrics.health.changes counter β€” connection, queue, severity
queue_metrics.queue.depth_threshold.exceeded counter β€” connection, queue
queue_metrics.jobs.debounced counter β€” job.name, queue
queue_metrics.baseline.recalculations counter β€” connection, queue, significant

Severe health changes, depth threshold breaches and scaling recommendations are additionally emitted as structured OTLP events. Per-job durations, memory and outcome counters are deliberately not re-exported β€” laravel-telemetry's own queue instrumentation already covers those.

Running both the built-in Prometheus exporter and the telemetry integration exposes the same queue state twice β€” php artisan queue-metrics:doctor diagnoses your setup and warns about double exposure.

RESTful API

Complete HTTP API for integration with custom dashboards and monitoring tools.

Events

Extensible architecture with events for reactive monitoring and notifications.

Requirements

Note: Laravel 12.19+ is recommended for most accurate queue metrics (Laravel PR #56010). Earlier versions use driver-specific implementations.

Configuration

Storage Drivers

Redis (default, recommended)

Redis is the recommended driver for all workloads. It handles high-frequency metrics writes with minimal overhead.

Database

For applications without Redis infrastructure, a database driver is available. This stores metrics in 4 database tables using the same schema as your application database.

Run the migration to create the metrics tables:

Important: The database driver is designed for low-scale workloads (< 10 workers). At higher scale, metrics writes create contention on the same database your queue jobs use. Use Redis for production with moderate to high workloads.

Recommended setting for database driver: Set QUEUE_METRICS_MAX_SAMPLES=500 to keep table sizes manageable.

The database cleanup command runs automatically every minute when using the database driver, removing expired data and trimming sample tables.

API Authentication

Scheduled Commands

The package automatically schedules necessary maintenance tasks. You can disable or configure this behavior in config/queue-metrics.php:

If you prefer to manually schedule commands in your Console/Kernel.php (or routes/console.php), simply set 'enabled' => false.

β†’ Complete configuration reference

Usage Examples

Monitor Job Performance

Check Queue Health

React to Events

Multi-Tenancy Integration

β†’ More examples

API Endpoints

β†’ Complete API reference

Prometheus Integration

Query metrics:

β†’ Prometheus setup guide

Architecture

Queue Metrics for Laravel uses a clean, layered architecture:

β†’ Architecture deep dive

Performance

β†’ Performance tuning guide

Testing

Contributing

Please see the GitHub repository to open issues or pull requests.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


πŸ“š Read the full documentation β†’


All versions of laravel-queue-metrics with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3|^8.4|^8.5
cboxdk/system-metrics Version ^3.0
illuminate/contracts Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.16
spatie/laravel-prometheus Version ^1.3
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 cboxdk/laravel-queue-metrics contains the following files

Loading the files please wait ...