Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Prometheus Client Bundle Laravel Package

dbstudios/prometheus-client-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

To add the bundle, run the following command.

$ composer require dbstudios/prometheus-client-bundle

If your project is using Symfony Flex, the bundle should be enabled automatically. If not, you will need to add DaybreakStudios\PrometheusClientBundle\DaybreakStudiosPrometheusClientBundle to your bundles file.

Next, if your config directory, you'll need to add the base configuration for the bundle.

dbstudios_prometheus:
    adapter: DaybreakStudios\PrometheusClient\Adapter\ApcuAdapter

Where the base configuration should be placed will depend on your Symfony version. For 3.4 and older, this should be in app/config/config.yml. For newer Symfony versions (4.0 and greater), this should be config/packages/dbstudios_prometheus.yaml.

The value of adapter must be the ID of a service extending DaybreakStudios\PrometheusClient\Adapter\AdapterInterface. See the documentation for dbstudios/prometheus-client for a list of built-in adapters.

Configuration

A complete, annotated configuration for this bundle may be found below.

dbstudios_prometheus:
    # The ID of a service implementing DaybreakStudios\PrometheusClient\Adapter\AdapterInterface. No services are
    # registered by default, so you will need to choose an appropriate adapter for your environment, register it, then
    # reference it here.
    adapter: DaybreakStudios\PrometheusClient\Adapter\ApcuAdapter
    
    # The ID of a service implementing DaybreakStudios\PrometheusClient\CollectorRegistryInterface, OR the
    # fully-qualified class name of a class implementing the aforementioned interface. In the second case, the bundle
    # will automatically register the provided class as a service, using the class name as it's service ID.
    #
    # If you're using the built-in collector registry, you do not need to provide a value here.
    registry: DaybreakStudios\PrometheusClient\CollectorRegistry 
    
    # The metrics section contains options for the built-in metrics endpoint listener, which provides the information
    # Prometheus needs to scrape your application.
    metrics:
        # Whether or not the built-in metrics endpoint is enabled. If this option is false, you will need to implement
        # the metrics endpoint on your own (see the section titled "Custom Metrics Endpoint").
        enabled: true
        
        # The path to use for the metrics endpoint. If `metrics.enabled` is false, this option is ignored.
        path: /metrics

Custom Metrics Endpoint

By default, this bundle registers a listener that responds to any requests to dbstudios_prometheus.metrics.path with the metrics data that Prometheus will need to scrape from your application. If you'd like to implement this endpoint on your own, see DaybreakStudios\PrometheusClientBundle\Listeners\MetricsEndpointListener::onKernelRequest() for an example implementation.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours