Download the PHP package faktly/laravel-prometheus-metrics without Composer

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

Laravel Prometheus Metrics

Tests Publish Release PHP requirement Contributors Latest Version on Packagist Downloads


Stop guessing. Start measuring. Expose production-grade Laravel metrics as JSON/YAML/Prometheus so Prometheus, Grafana, and any monitoring stack can tell you what is really happening inside your app.

If you have ever asked, “Why is the API slow?” or “Are queue jobs backing up?” or “Did deploy X increase errors?”, this package helps you answer in minutes, not hours.


Why this exists

Most Laravel apps only become “observable” after something breaks.

This exporter gives you fast visibility into the stuff that actually moves the needle:


What you get

10+ Metric Collectors: Database, Sessions, Queue, Mail, Cache, Users, Event Sourcing, Permissions, Horizon, Meilisearch.

🔌 Fully optional: Enable what you need, disable what you do not.

🚀 High performance: Built-in caching with configurable TTL.

🔒 Secure by default: Token-protected endpoint.

📦 Modern stack: Laravel 11+, PHP 8.4+.

📊 JSON export: Prometheus-friendly, Grafana-friendly, also easy to consume for custom tooling.


Quick Start

Installation

Count user session with prometheus_metrics_user_sessions table

If you use non-database session drivers, “active sessions” can be hard to measure reliably.

This package includes a database table plus middleware, so you can still count user sessions regardless of your session driver.

If you use UUID or ULID primary keys, adjust the published migration before applying it.

Configure

Configure Prometheus scrape config

Add this to /etc/prometheus/prometheus.yml :

Replace YOUR_TOKEN and YOUR_HOST.

You can create a safe token with openssl rand -hex 64 and YOUR_HOST could be a local IP:PORT combination or your website HOST:PORT.

Verify it works

Register Middleware for HTTP metrics

In legacy apps or custom middleware setups, register the HTTP metrics middleware early (but after session start).

Add this to Kernel.php, or in newer Laravel versions bootstrap/app.php:

Test Locally

PHPUnit / pest

During tests you might want to disable the extension. Simply add <env name="PROMETHEUS_METRICS_ENABLED" value="false"/> to your phpunit.xml file.

What Gets Measured

Collector Metrics Optional Requires
Database Active connections, queries Laravel DB
Sessions Active count, driver info Laravel Sessions
Queue Pending/failed jobs, per-queue Laravel Queue
Mail Sent/failed count Laravel Mail
Cache Driver info, hits/misses Laravel Cache
Users Total count, active, per-role Laravel Auth
Event Sourcing Events total, aggregates, per-type Spatie
Permissions Roles, permissions, users per role Spatie
Horizon Jobs per minute, processes Laravel
Meilisearch Health, indexes, documents Meilisearch

License

MIT License. See LICENSE.md for details.


All versions of laravel-prometheus-metrics with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4 || ^8.5
illuminate/support Version ^11 || ^12 || ^13
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 faktly/laravel-prometheus-metrics contains the following files

Loading the files please wait ...