PHPackages                             acseo/sylius-prometheus-metrics-plugin - 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. acseo/sylius-prometheus-metrics-plugin

ActiveSylius-plugin[Logging &amp; Monitoring](/categories/logging)

acseo/sylius-prometheus-metrics-plugin
======================================

Sylius Prometheus Metrics Plugin

v2.1(3mo ago)24.8k1[1 PRs](https://github.com/acseo/SyliusPrometheusMetricsPlugin/pulls)MITMakefilePHP ^8.0CI passing

Since Jun 14Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/acseo/SyliusPrometheusMetricsPlugin)[ Packagist](https://packagist.org/packages/acseo/sylius-prometheus-metrics-plugin)[ RSS](/packages/acseo-sylius-prometheus-metrics-plugin/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (2)Dependencies (6)Versions (4)Used By (0)

 [ ![ACSEO]() ](https://www.acseo.fr)

Sylius Prometheus Metrics
 [ ![](https://camo.githubusercontent.com/7e8c13913f133060a5eea1a96d91b8949a8bf88702a73f477defe7b38aac4c03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f616373656f2f73796c6975732d70726f6d6574686575732d6d6574726963732d706c7567696e2e737667) ](https://packagist.org/packages/acseo/sylius-prometheus-metrics-plugin "License") [ ![](https://camo.githubusercontent.com/d5db3c5130fbb862c88025b85e56b916969cdd0020bd8e5607d103d7e4bbd26d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616373656f2f73796c6975732d70726f6d6574686575732d6d6574726963732d706c7567696e2e737667) ](https://packagist.org/packages/acseo/sylius-prometheus-metrics-plugin "Version")
=============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#sylius-prometheus-metrics--------------------------------)

Features
--------

[](#features)

### Observability

[](#observability)

We use the *artprima/prometheus-metrics-bundle* () bundle to collect metrics in the Prometheus format, which can then be used to build a dashboard with Grafana. These metrics are visible at the **/metrics/prometheus** URL of the website.

Default metrics are generated. It is possible to create custom metrics to track "Business" data, such as the number of created orders or the order amount.

 [![](https://camo.githubusercontent.com/8256f47fe846918480ff79761e9b906cbec8d2e331e4d531be5fd5029c5db43e/68747470733a2f2f70726f6d6574686575732e696f2f6173736574732f67726166616e615f70726f6d6574686575732e706e67)](https://camo.githubusercontent.com/8256f47fe846918480ff79761e9b906cbec8d2e331e4d531be5fd5029c5db43e/68747470733a2f2f70726f6d6574686575732e696f2f6173736574732f67726166616e615f70726f6d6574686575732e706e67)

Installation for development
----------------------------

[](#installation-for-development)

1. Run `make install`.

Installation on your project
----------------------------

[](#installation-on-your-project)

1. Run `$ composer require acseo/sylius-prometheus-metrics-plugin`.
2. Add these few lines to the `config/state_machine/sylius_payment.yaml`

```
winzou_state_machine:
   sylius_payment:
      callbacks:
         after:
            sylius_order_items_complete_collector:
               on: 'complete'
               do: ['@metrics.order_collector', 'incrementPrometheusCounters']
               args: ["object.getOrder()"]
```

Installation without Symfony Flex
---------------------------------

[](#installation-without-symfony-flex)

1. Run `$ composer require acseo/sylius-prometheus-metrics-plugin`.
2. Enable the plugin in bundles.php

```
