Download the PHP package fjogeleit/prometheus-messenger-middleware without Composer
On this page you can find all versions of the php package fjogeleit/prometheus-messenger-middleware. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fjogeleit/prometheus-messenger-middleware
More information about fjogeleit/prometheus-messenger-middleware
Files in fjogeleit/prometheus-messenger-middleware
Package prometheus-messenger-middleware
Short Description Prometheus Middleware for the Symfony Messenger Component
License MIT
Informations about the package prometheus-messenger-middleware
Prometheus Messenger Middleware
A Simple Middleware to Monitor your Symfony Messenger Component with two Prometheus Counter Metrics per MessageBus.
- Counter overall executed Messages
- Counter failed Messages
Dependencies
- PHP >= 7.2.5
- promphp/prometheus_client_php
- symfony/messenger
Installation
Usage
Configure this Middleware to your MessageBus
Symfony Basic Example
Register your Services
Configure Middleware
Generated Example Counter Response with the default Labels "message" as full qualified MessageName and "label" as Message ClassName
Advanced Usage
You can also configure your own Labels and provide the related Values
Configure your own labels as additional service argument
Create a LabelValueProvider
Create your own LabelValueProvider by implementing the LabelValueProviderInterface
Add your new LabelValueProvider to your ServiceConfiguration
You can also provide custom labels for the ErrorCounter with the ErrorLabelValueProviderInterface
And the updated ServiceConfiguration
Full PrometheusMiddleware API
Property | Required | Description |
---|---|---|
CollectorRegistry $collectorRegistry | required | Underlying CollectorRegistry to generate and persist your metrics |
string $metricName | optional | Default message , used as "name" for your Counter |
string $helpText | optional | Default Executed Messages , used as Counter help text |
array $labels | optional | Default ['message', 'label'] , default provided Counter labels |
LabelValueProviderInterface $provider | optional | Default DefaultLabelValueProvider , provides the Counter label related values |
string $errorHelpText | optional | Default Failed Messages , used as Error Counter help text |
array $errorLabels | optional | Default ['message', 'label'] , default provided Error Counter labels |
ErrorLabelValueProviderInterface $errorLabelValueProvider | optional | Default DefaultErrorLabelValueProvider , provides the Error Counter label related values |
All versions of prometheus-messenger-middleware with dependencies
promphp/prometheus_client_php Version ^2.0
symfony/messenger Version ^5.0 || ^6.0 || ^7.0