PHPackages                             gh05tpl/messenger-prometheus-bundle - 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. gh05tpl/messenger-prometheus-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

gh05tpl/messenger-prometheus-bundle
===================================

Symfony bundle exposing Messenger worker metrics for Prometheus.

00PHPCI passing

Since Jun 12Pushed 1mo agoCompare

[ Source](https://github.com/Gh05t-PL/messenger-prometheus-bundle)[ Packagist](https://packagist.org/packages/gh05tpl/messenger-prometheus-bundle)[ RSS](/packages/gh05tpl-messenger-prometheus-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Messenger Prometheus Bundle
===========================

[](#messenger-prometheus-bundle)

Symfony bundle exposing Messenger worker metrics for Prometheus.

It integrates with `artprima/prometheus-metrics-bundle` and increments counters when Symfony Messenger workers receive, handle, fail, or retry messages.

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

[](#installation)

```
composer require gh05tpl/messenger-prometheus-bundle
```

If your application does not use Symfony Flex auto-registration, enable both bundles manually:

```
// config/bundles.php

return [
    Artprima\PrometheusMetricsBundle\ArtprimaPrometheusMetricsBundle::class => ['all' => true],
    Gh05tPL\MessengerPrometheusBundle\Gh05tPLMessengerPrometheusBundle::class => ['all' => true],
];
```

Configure Prometheus Metrics Bundle
-----------------------------------

[](#configure-prometheus-metrics-bundle)

For Messenger worker metrics, use shared storage so the worker process and the HTTP process exposing metrics can see the same counters. Redis is the safest default.

```
# config/packages/artprima_prometheus_metrics.yaml
artprima_prometheus_metrics:
  namespace: app
  storage:
    type: redis
    host: '%env(default:redis:REDIS_HOST)%'
    port: '%env(int:default:6379:REDIS_PORT)%'
    prefix: app_prometheus
```

For a quick local smoke test only, you can use in-memory storage:

```
# config/packages/artprima_prometheus_metrics.yaml
artprima_prometheus_metrics:
  namespace: app
  storage:
    type: in_memory
```

In-memory storage is not recommended for real Messenger worker metrics because workers and web requests usually run in different PHP processes.

Expose Metrics Endpoint
-----------------------

[](#expose-metrics-endpoint)

Import the route provided by `artprima/prometheus-metrics-bundle`:

```
# config/routes/prometheus.yaml
prometheus_metrics:
  resource: '@ArtprimaPrometheusMetricsBundle/Resources/config/routing.yaml'
```

The endpoint is available at:

```
/metrics/prometheus

```

Point Prometheus at that endpoint, for example:

```
scrape_configs:
  - job_name: symfony
    metrics_path: /metrics/prometheus
    static_configs:
      - targets:
          - app.example.com
```

Run Messenger Workers
---------------------

[](#run-messenger-workers)

No extra code is required. Once the bundle is enabled, it subscribes to Symfony Messenger worker events automatically.

```
php bin/console messenger:consume async -vv
```

The bundle records these counters:

```
app_messenger_worker_messages_total{event,message_class,receiver_name}
app_messenger_worker_failures_total{message_class,receiver_name,exception_class,will_retry}

```

The `event` label can be one of:

```
received
handled
failed
retried

```

The metric prefix comes from `artprima_prometheus_metrics.namespace`. If you set `namespace: my_app`, the counters will be named:

```
my_app_messenger_worker_messages_total
my_app_messenger_worker_failures_total

```

Development
-----------

[](#development)

This repository includes a Docker-based development environment.

```
make build
make install
make test
make validate
```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance60

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

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.

### Community

Maintainers

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

---

Top Contributors

[![Gh05t-PL](https://avatars.githubusercontent.com/u/27134972?v=4)](https://github.com/Gh05t-PL "Gh05t-PL (9 commits)")

### Embed Badge

![Health badge](/badges/gh05tpl-messenger-prometheus-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/gh05tpl-messenger-prometheus-bundle/health.svg)](https://phpackages.com/packages/gh05tpl-messenger-prometheus-bundle)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.9k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

2041.5M290](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2428.5M358](/packages/open-telemetry-sdk)

PHPackages © 2026

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