PHPackages                             prom-php-exporter/laravel-exporter - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. prom-php-exporter/laravel-exporter

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

prom-php-exporter/laravel-exporter
==================================

prometheus laravel exporter

4.1(5y ago)112PHPPHP ^7.2

Since Oct 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jaafar173/prom-php-exporter)[ Packagist](https://packagist.org/packages/prom-php-exporter/laravel-exporter)[ RSS](/packages/prom-php-exporter-laravel-exporter/feed)WikiDiscussions master Synced today

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

prometheus-laravel-exporter
===========================

[](#prometheus-laravel-exporter)

A prometheus exporter for Laravel.

Installation
------------

[](#installation)

```
composer require lcmf/promethus
```

Register the service provider in app.php

```
'providers' => [
    // ...
    Lcmf\Prometheus\LaravelExporter\PrometheusServiceProvider::class,
]
```

Register the facade in app.php

```
'aliases' => [
    // ...
    'Prometheus' => Lcmf\Prometheus\LaravelExporter\PrometheusFacade::class,
]
```

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

[](#configuration)

The package has a default configuration which uses the following environment variables.

```
PROMETHEUS_NAMESPACE=app

PROMETHEUS_METRICS_ROUTE_ENABLED=true
PROMETHEUS_METRICS_ROUTE_PATH=metrics
PROMETHEUS_METRICS_ROUTE_MIDDLEWARE=null

PROMETHEUS_STORAGE_ADAPTER=memory #or redis

PROMETHEUS_REDIS_HOST=localhost
PROMETHEUS_REDIS_PORT=6379
PROMETHEUS_REDIS_DATABASE=1
PROMETHEUS_REDIS_PASSWORD=xxxx
PROMETHEUS_REDIS_PREFIX=PROMETHEUS_

```

Usage
-----

[](#usage)

```
$exporter = app('prometheus');

// export all metrics
// this is called automatically when the /metrics end-point is hit
var_dump($exporter->export());

// the following methods can be used to create and interact with counters, gauges and histograms directly
// these methods will typically be called by collectors, but can be used to register any custom metrics directly,
// without the need of a collector

// create a counter
$counter = $exporter->registerCounter('search_requests_total', 'The total number of search requests.');
$counter->inc(); // increment by 1
$counter->incBy(2);

// create a counter (with labels)
$counter = $exporter->registerCounter('search_requests_total', 'The total number of search requests.', ['request_type']);
$counter->inc(['GET']); // increment by 1
$counter->incBy(2, ['GET']);

// retrieve a counter
$counter = $exporter->getCounter('search_requests_total');

// create a gauge
$gauge = $exporter->registerGauge('users_online_total', 'The total number of users online.');
$gauge->inc(); // increment by 1
$gauge->incBy(2);
$gauge->dec(); // decrement by 1
$gauge->decBy(2);
$gauge->set(36);

// create a gauge (with labels)
$gauge = $exporter->registerGauge('users_online_total', 'The total number of users online.', ['group']);
$gauge->inc(['staff']); // increment by 1
$gauge->incBy(2, ['staff']);
$gauge->dec(['staff']); // decrement by 1
$gauge->decBy(2, ['staff']);
$gauge->set(36, ['staff']);

// retrieve a gauge
$counter = $exporter->getGauge('users_online_total');

// create a histogram
$histogram = $exporter->registerHistogram(
    'response_time_seconds',
    'The response time of a request.',
    [],
    [0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0]
);
// the buckets must be in asc order
// if buckets aren't specified, the default 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0 buckets will be used
$histogram->observe(5.0);

// create a histogram (with labels)
$histogram = $exporter->registerHistogram(
    'response_time_seconds',
    'The response time of a request.',
    ['request_type'],
    [0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0]
);
// the buckets must be in asc order
// if buckets aren't specified, the default 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0 buckets will be used
$histogram->observe(5.0, ['GET']);

// retrieve a histogram
$counter = $exporter->getHistogram('response_time_seconds');
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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

10

Last Release

2126d ago

Major Versions

1.0 → 2.02020-10-21

2.0 → 3.02020-10-21

3.5 → 4.02020-10-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/457807805152d8d47311c3c6001fedf2bcb8d3c214971bcc9e956f68b2d00ea2?d=identicon)[jaafar](/maintainers/jaafar)

---

Top Contributors

[![jaafar173](https://avatars.githubusercontent.com/u/10260654?v=4)](https://github.com/jaafar173 "jaafar173 (15 commits)")

### Embed Badge

![Health badge](/badges/prom-php-exporter-laravel-exporter/health.svg)

```
[![Health](https://phpackages.com/badges/prom-php-exporter-laravel-exporter/health.svg)](https://phpackages.com/packages/prom-php-exporter-laravel-exporter)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M227](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[webcrafts-studio/lens-for-laravel

A local-first WCAG accessibility auditor for Laravel with axe-core, source mapping, CI workflows, and optional AI fixes.

464.2k](/packages/webcrafts-studio-lens-for-laravel)

PHPackages © 2026

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