Download the PHP package vntrungld/prometheus-exporter-opcache-collector without Composer

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

Prometheus Exporter OPcache Collector

Latest Version on Packagist Total Downloads Tests License

An OPcache metrics collector for Prometheus Exporter in Laravel applications. This package collects OPcache memory usage, cache statistics, interned strings, JIT status, and configuration limits, exposing them in Prometheus format.

Requirements

Laravel PHP Package
6.x 7.2 - 8.0 1.x
7.x 7.2 - 8.0 1.x
8.x 7.3 - 8.1 1.x
9.x 8.0 - 8.2 1.x
10.x 8.1 - 8.3 1.x
11.x 8.2 - 8.4 1.x
12.x 8.2 - 8.4 1.x

Installation

Install via Composer:

The package uses Laravel's auto-discovery, so the service provider will be automatically registered.

Configuration

Add the collector set to your prometheus-exporter configuration file (config/prometheus-exporter.php):

Available Metrics

Up Status

Metric Name Type Description
opcache_up Gauge Whether OPcache is available (1=up, 0=down)

Memory Usage

Metric Name Type Description
opcache_used_memory_bytes Gauge Used memory in bytes
opcache_free_memory_bytes Gauge Free memory in bytes
opcache_wasted_memory_bytes Gauge Wasted memory in bytes
opcache_wasted_memory_percentage Gauge Wasted memory as percentage

Cache Statistics

Metric Name Type Description
opcache_cached_scripts Gauge Number of cached scripts
opcache_hits_total Counter Total cache hits
opcache_misses_total Counter Total cache misses
opcache_cached_keys Gauge Number of keys in the hash table
opcache_max_cached_keys Gauge Maximum slots in the hash table
opcache_oom_restarts Gauge Out-of-memory restart count
opcache_hash_restarts Gauge Hash table overflow restart count
opcache_manual_restarts Gauge Manual restart count

Interned Strings

Metric Name Type Description
opcache_interned_strings_buffer_bytes Gauge Total buffer size
opcache_interned_strings_used_bytes Gauge Used buffer memory
opcache_interned_strings_free_bytes Gauge Free buffer memory
opcache_interned_strings_count Gauge Number of interned strings

JIT (PHP 8.0+)

These metrics are only available when JIT is present. They are silently skipped on PHP < 8.0.

Metric Name Type Description
opcache_jit_enabled Gauge Whether JIT is enabled
opcache_jit_buffer_size_bytes Gauge Total JIT buffer size
opcache_jit_buffer_used_bytes Gauge Used JIT buffer
opcache_jit_buffer_free_bytes Gauge Free JIT buffer

Configuration Limits

These gauges expose OPcache configuration values, useful for computing utilization ratios in PromQL.

Metric Name Type Source
opcache_config_memory_limit_bytes Gauge opcache.memory_consumption
opcache_config_max_accelerated_files Gauge opcache.max_accelerated_files
opcache_config_interned_strings_buffer_bytes Gauge opcache.interned_strings_buffer
opcache_config_jit_buffer_size_bytes Gauge opcache.jit_buffer_size (8.0+)

Example PromQL Queries

Example Output

OPcache Configuration

For this collector to work, the OPcache extension must be enabled. Ensure your php.ini has:

The collector uses PHP's built-in opcache_get_status() and opcache_get_configuration() functions. When OPcache is not available, the opcache_up metric reports 0 and all other metrics are silently skipped.

Testing

Run the test suite:

Or with PHPUnit directly:

Changelog

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.


All versions of prometheus-exporter-opcache-collector with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
vntrungld/prometheus-exporter Version ^1.1
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 vntrungld/prometheus-exporter-opcache-collector contains the following files

Loading the files please wait ...