PHPackages                             saifh/laravel-phpfpm-prometheus-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. saifh/laravel-phpfpm-prometheus-exporter

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

saifh/laravel-phpfpm-prometheus-exporter
========================================

Exposes a prometheus /metrics endpoint in your Laravel application, intended for use as a Kubernetes HPA driver.

1.0.1(1y ago)37MITPHP

Since Dec 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/saifxhatem/laravel-phpfpm-prometheus-exporter)[ Packagist](https://packagist.org/packages/saifh/laravel-phpfpm-prometheus-exporter)[ RSS](/packages/saifh-laravel-phpfpm-prometheus-exporter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Laravel PHP-FPM Prometheus Exporter
===================================

[](#laravel-php-fpm-prometheus-exporter)

This project exposes a Prometheus metrics endpoint in your Laravel application, based on FPM's current state.

It exposes 3 metrics:

1. Idle processes
2. Total processes
3. Active processes

This can be used in conjunction with [Prometheus Adapter](https://github.com/kubernetes-sigs/prometheus-adapter) to give you new metrics to scale your application up and down with Kubernetes.

Config
======

[](#config)

Publish the config file via `php artisan vendor:publish --tag=prometheus`to customize your configuration.

Prometheus Adapter Config
=========================

[](#prometheus-adapter-config)

Given the following rule:

```
rules:
  default: false
  custom:
    - seriesQuery: 'phpfpm_active_processes{namespace!="",pod_name!=""}'
      resources:
        overrides:
          namespace:
            resource: namespace
          pod_name:
            resource: pod
      name:
        matches: "phpfpm_active_processes"
        as: "phpfpm_active_processes_utilization"
      metricsQuery: avg(phpfpm_active_processes{} / phpfpm_total_processes{}) by ()
```

And the following Kubernetes HPA

```
kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2
metadata:
  name: php-fpm-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: php-fpm
  # autoscale between 1 and 2 replicas
  minReplicas: 1
  maxReplicas: 2
  metrics:
  # use a "Pods" metric, which takes the average of the
  # given metric across all pods controlled by the autoscaling target
  - type: Pods
    pods:
      # use the metric that you used above: pods/http_requests
      metric:
        name: phpfpm_active_processes_utilization
      #Value: 500m: Targets 50% utilization
      target:
        type: Value
        averageValue: 500m
```

This will trigger a scale up when your average worker utilization hits 50%

Full Example
============

[](#full-example)

Coming soon.

Note
====

[](#note)

This project was heavily inspired by [hipages/php-fpm\_exporter](https://github.com/hipages/php-fpm_exporter).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance41

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Unknown

Total

1

Last Release

498d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c1b89fc83052d437747c0ab9a8c6d040cafc8b9667f70ea55833421a6677cd01?d=identicon)[saifxhatem](/maintainers/saifxhatem)

### Embed Badge

![Health badge](/badges/saifh-laravel-phpfpm-prometheus-exporter/health.svg)

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

###  Alternatives

[lkaemmerling/laravel-horizon-prometheus-exporter

A small package to gain and export long time information from Laravel &amp; Horizon for Prometheus.

1602.0M](/packages/lkaemmerling-laravel-horizon-prometheus-exporter)[promphp/prometheus_push_gateway_php

Prometheus Push Gateway client for PHP applications.

312.2M6](/packages/promphp-prometheus-push-gateway-php)[arquivei/laravel-prometheus-exporter

A Prometheus exporter for Laravel and Lumen

20807.4k1](/packages/arquivei-laravel-prometheus-exporter)

PHPackages © 2026

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