Download the PHP package vmorozov/laravel-prometheus without Composer

On this page you can find all versions of the php package vmorozov/laravel-prometheus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-prometheus

Prometheus client for laravel framework

Latest Version on Packagist Tests Total Downloads

A Laravel package for integrating Prometheus metrics collection into your Laravel application.
This package makes it easy to collect and expose metrics for monitoring your application's performance and behavior.

Installation

  1. Install the package via composer:

  2. Publish vendor files:

Upgrading version

  1. Update the package version in composer.json
  2. Run

  3. Run command to update configs:

  4. Run clear stored metrics:

Usage

This package provides default metrics that allow you to monitor response times (divided into buckets and percentiles) and request counts.
It also allows you to create custom metrics and collectors for your specific needs.

To see the collected metrics, go to the /metrics endpoint of your application.
This endpoint returns metrics in the Prometheus exposition format, which can be scraped by a Prometheus server.

You can clear stored metrics using the built-in prometheus:clear_stored_metrics command: ``

Configuration

The package can be configured using the laravel-prometheus.php configuration file.
This file is published to your application's config directory when you run the vendor:publish command.

Key configuration options include:

For detailed configuration information, see the Configuration Documentation.

Default Metrics

The package includes two default metrics:

  1. Request Duration Histogram: Measures the duration of HTTP requests.
  2. Queue Size Gauge: Measures the size of Laravel queues (you have to configure which connections and queues to monitor).

For more information about the default metrics, see the Default Metrics Documentation.

Custom Metrics

You can create custom metrics to monitor specific aspects of your application. The package supports three types of metrics:

  1. Counter: A cumulative metric that only increases (requests_processed, users_registered, etc.)
  2. Gauge: A metric that can go up and down and represents current state of something (example: queue_size, cpu_load, etc.)
  3. Histogram: A metric that samples observations and counts them in buckets (when you need to have quantiles of your metric values)

For information on creating and using custom metrics, see the Custom Metrics Documentation.

On-Demand Metrics Collectors

On-Demand Metrics Collectors are classes that collect metrics only when the metrics endpoint is accessed.
This is useful for metrics that are expensive to collect or that don't need to be updated on every request.

For information on creating and using custom On-Demand Metrics Collectors, see the On-Demand Metrics Collectors Documentation.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-prometheus with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version >=9.0
promphp/prometheus_client_php Version ^2.7
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vmorozov/laravel-prometheus contains the following files

Loading the files please wait ...