Download the PHP package liveintent/laravel-prometheus-exporter without Composer

On this page you can find all versions of the php package liveintent/laravel-prometheus-exporter. 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-exporter

Laravel Prometheus Exporter

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is a Laravel package that automatically collects data and exposes a /metrics endpoint in your application which can then be scraped by Prometheus.

For a full list of exported metrics, see exporters.

Installation

You can install the package via composer:

Once installed run the following command to generate the metrics config file.

The package will auto-register itself.

Usage

The metrics config file contains a list of enabled exporters. Each exporter will collect data and store it in your configured data store.

Storage

The storage drivers currently supperted are redis, apc, and in-memory. You may adjust this value by setting the env METRICS_STORAGE_DRIVER.

The package uses the in-memory driver by default to help you get started, but you should change this as soon as you are ready as it's not useful for much beyond testing.

You will need the appropriate pecl extension installed (apc or php-redis).

If you need to clear the storage, you may do so with:

Exporters

Request Duration Historam Exporter - http_request_duration_seconds_bucket

This will export histogram data for request duration.

Example
Labels
name description example
service name of the service my-amazing-api
environment the environment qa, prod, etc
response_code the http response code 200, 400, etc
method the http method GET, POST, etc
path the uri of the request /, /posts, etc

Request Memory Usage Historam Exporter - http_request_memory_usage_bytes

This will export histogram data for request memory usage.

Example
Labels
name description example
service name of the service my-amazing-api
environment the environment qa, prod, etc
code the http response code 200, 400, etc
method the http method GET, POST, etc
path the uri of the request /, /posts, etc

Job Processing Time Historam Exporter - job_process_time_seconds_bucket

This will export histogram data for job execution duration.

Example
Labels
name description example
service name of the service my-amazing-api
environment the environment qa, prod, etc
name the classname of the job App\\Jobs\\ProcessPayment
status the job status procesed, failed

Job Wait Time Historam Exporter - job_wait_time_seconds_bucket

This will export histogram data for the time a job had to wait on the queue.

Note: This exporter relies on Laravel Horizon.

Example
Labels
name description example
service name of the service my-amazing-api
environment the environment qa, prod, etc
name the classname of the job App\\Jobs\\ProcessPayment

Query Duration Historam Exporter - db_query_time_seconds_bucket

This will export histogram data for query execution times.

Example
Labels
name description example
service name of the service my-amazing-api
environment the environment qa, prod, etc
sql the sql query SELECT * FROM `users`

Writing New Exporters

You may also write your own exporter. You only need to implement two methods, register and export.

The following example increments a counter every time the / route is visited.

Register your Exporter class by placing it in the list of exporters found in the metrics config file.


All versions of laravel-prometheus-exporter with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4|^8.0
illuminate/contracts Version ^8.0
nesbot/carbon Version ^2.46
promphp/prometheus_client_php Version ^2.2
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 liveintent/laravel-prometheus-exporter contains the following files

Loading the files please wait ....