Download the PHP package grzegorzdrozd/opentelemetry-metrics-pdo without Composer

On this page you can find all versions of the php package grzegorzdrozd/opentelemetry-metrics-pdo. 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 opentelemetry-metrics-pdo

OpenTelemetry metrics for PDO

Please read https://opentelemetry.io/docs/concepts/signals/metrics/ for basic information about metrics. .

Overview

Metric collection is installed via Composer, and metrics are sent using default collector for selected PDO operations.

Configuration

You can disable the extension using runtime configuration:

Recommended OTEL Metrics settings:

Use this setting to send all data like spanId, traceId, and attributes with metric value.

To make sure that all metrics are sent and not pre-processed before it is best to send this to delta. Otherwise, metrics like db.client.connection.count will always send 0 instead of +1 when connection is established and -1 when connection is closed. This metric is specially useful in long-running code that runs from cli like console commands or cron jobs. But it also contains both timestamps — one for connection increase, and one for connection number decrease. Combined with flushing from time to time (more often than on the script end) will show current number of established db connections. To force flush, you can use this in one of the console events or somewhere in your processing loop:

Adding Custom Attributes

You can add custom attributes to your PDO metrics either globally or per specific PDO/PDOStatement instance. The following methods are available:

These attributes will be included with all metrics generated for the relevant scope (global or instance-specific). Instance-specific attributes are combined with global attributes when metrics are generated.

This is useful for tracking information that might be lost from spans due to sampling on traces.

Additional configuration options

Disable context tracking

If you don't want to add traceId and spanId to metrics, you can disable it using the following env variable (it is enabled by default):

Disable adding statements to metrics

If you don't want to add a statement to metrics, you can disable it using the following env variable (it is enabled by default):

Disable tracking number of returned rows

If you don't want to send the number of returned rows (as a separate, histogram metric), you can disable it using the following env variable (it is enabled by default):


All versions of opentelemetry-metrics-pdo with dependencies

PHP Build Version
Package Version
Requires ext-opentelemetry Version *
ext-pdo Version *
open-telemetry/api Version ^1.0
open-telemetry/exporter-otlp Version ^1.2
open-telemetry/sem-conv Version ^1.24
php Version ^8.2
guzzlehttp/guzzle Version ^7.9
guzzlehttp/psr7 Version ^2.7
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 grzegorzdrozd/opentelemetry-metrics-pdo contains the following files

Loading the files please wait ....