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

ActiveLibrary

lyova/prometheus-bundle
=======================

Symfony bundle for Prometheus client

02PHP

Since Jan 18Pushed 3y agoCompare

[ Source](https://github.com/lyova/prometheus-bundle)[ Packagist](https://packagist.org/packages/lyova/prometheus-bundle)[ RSS](/packages/lyova-prometheus-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

TweedeGolfPrometheusBundle
==========================

[](#tweedegolfprometheusbundle)

A Symfony bundle for the [tweede golf prometheus client](https://github.com/tweedegolf/prometheus-client). For more information on Prometheus you can [check their website](https://prometheus.io).

Installation and configuration
------------------------------

[](#installation-and-configuration)

Using [Composer](https://getcomposer.org) add the bundle to your dependencies using the require command:

```
composer require tweedegolf/prometheus-bundle

```

### Add the bundle to your AppKernel

[](#add-the-bundle-to-your-appkernel)

Add the bundle in your `app/AppKernel.php`:

```
public function registerBundles()
{
    return array(
        // ...
        new TweedeGolf\PrometheusBundle\TweedeGolfPrometheusBundle(),
        // ...
    );
}
```

### Configure storage, collectors and routes

[](#configure-storage-collectors-and-routes)

To allow prometheus to scrape your metrics from your application, make sure you make a route available for the prometheus metrics controller:

```
tweede_golf_prometheus:
    resource: "@TweedeGolfPrometheusBundle/Resources/config/routing.yml"
    prefix: /
```

You can also implement your own controller, take a look at the source code of `TweedeGolf\PrometheusBundle\Controller\MetricsController::metricsAction`. You can configure some aspects of the prometheus client using the configuration, the default values are shown below:

```
tweede_golf_prometheus:
    storage_adapter_service: TweedeGolf\PrometheusClient\Storage\ApcuAdapter
    metrics_path: /metrics
    make_memory_adapter: true
    register_defaults: true
    collectors: ~
```

To adjust, create a section `tweede_golf_prometheus` in your `config.yml`. You may specify any number of collectors. An example where four different collectors are defined is shown below:

```
tweede_golf_prometheus:
    collectors:
        requests:
            counter:
                labels: [url]
                help: Number of requests
        throughput:
            gauge:
                labels: [url]
                help: Throughput per url
                initializer: 10.0
        response_timing:
            histogram:
                labels: [url]
                help: Response timings
                buckets: [0.1, 0.2, 0.3, 0.5, 0.7, 1, 2, 5, 10, 30, 60]
        shorthand_example:
            counter: ~
```

### Modifying (incrementing/observing/setting) metrics

[](#modifying-incrementingobservingsetting-metrics)

To modify a metric, retrieve it via the `CollectorRegistry` service and call one of the type specific metric modification methods.

```
use TweedeGolf\PrometheusClient\CollectorRegistry;

public function exampleAction()
{
    $metric = $this->get(CollectorRegistry::class)->getCounter('requests');
    $metric->inc();
}
```

### Register a collector service

[](#register-a-collector-service)

You can also register services as collectors with the collector registry. To do this, add a `tweede_golf_prometheus.collector` tag to your service and make sure the service implements the `CollectorInterface`. You can also use the factory methods of the registry service:

```
services:
    example.collector.test:
        class: TweedeGolf\PrometheusClient\Collector\Counter
        factory: TweedeGolf\PrometheusClient\CollectorRegistry:createCounter
        arguments: [test]
        tags: [tweede_golf_prometheus.collector]
```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

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/3032550f94d574dc0fb1b9b20ec5c92d44987fb93a6051d6f16e89934cf89d63?d=identicon)[lyovius](/maintainers/lyovius)

---

Top Contributors

[![rnijveld](https://avatars.githubusercontent.com/u/193783?v=4)](https://github.com/rnijveld "rnijveld (7 commits)")[![lyova](https://avatars.githubusercontent.com/u/1482396?v=4)](https://github.com/lyova "lyova (3 commits)")[![marlonbaeten](https://avatars.githubusercontent.com/u/885089?v=4)](https://github.com/marlonbaeten "marlonbaeten (2 commits)")[![Wassasin](https://avatars.githubusercontent.com/u/733400?v=4)](https://github.com/Wassasin "Wassasin (1 commits)")[![majoskorec](https://avatars.githubusercontent.com/u/10130278?v=4)](https://github.com/majoskorec "majoskorec (1 commits)")[![LeJeanbono](https://avatars.githubusercontent.com/u/11347342?v=4)](https://github.com/LeJeanbono "LeJeanbono (1 commits)")[![jbouzekri](https://avatars.githubusercontent.com/u/880996?v=4)](https://github.com/jbouzekri "jbouzekri (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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