Download the PHP package tweedegolf/prometheus-bundle without Composer
On this page you can find all versions of the php package tweedegolf/prometheus-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tweedegolf/prometheus-bundle
More information about tweedegolf/prometheus-bundle
Files in tweedegolf/prometheus-bundle
Package prometheus-bundle
Short Description Symfony bundle for Prometheus client
License MIT
Informations about the package prometheus-bundle
TweedeGolfPrometheusBundle
A Symfony bundle for the tweede golf prometheus client. For more information on Prometheus you can check their website.
Installation and configuration
Using Composer add the bundle to your dependencies using the require command:
composer require tweedegolf/prometheus-bundle
Add the bundle to your AppKernel
Add the bundle in your app/AppKernel.php
:
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:
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:
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:
Modifying (incrementing/observing/setting) metrics
To modify a metric, retrieve it via the CollectorRegistry
service and call
one of the type specific metric modification methods.
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:
All versions of prometheus-bundle with dependencies
tweedegolf/prometheus-client Version ^0.3
symfony/config Version ~2.7|~3.0|~4.0|~5.0
symfony/dependency-injection Version ~2.7|~3.0|~4.0|~5.0
symfony/framework-bundle Version ~2.7|~3.0|~4.0|~5.0
symfony/http-kernel Version ~2.7|~3.0|~4.0|~5.0