open-telemetry / sdk
SDK for OpenTelemetry PHP.
Requires
- php: ^8.1
- ext-json: *
- nyholm/psr7-server: ^1.1
- open-telemetry/api: ~1.0 || ~1.1
- open-telemetry/context: ^1.0
- open-telemetry/sem-conv: ^1.0
- php-http/discovery: ^1.14
- psr/http-client: ^1.0
- psr/http-client-implementation: ^1.0
- psr/http-factory-implementation: ^1.0
- psr/http-message: ^1.0.1|^2.0
- psr/log: ^1.1|^2.0|^3.0
- ramsey/uuid: ^3.0 || ^4.0
- symfony/polyfill-mbstring: ^1.23
- symfony/polyfill-php82: ^1.26
- tbachert/spi: ^1.0.1
Suggests
- ext-gmp: To support unlimited number of synchronous metric readers
- ext-mbstring: To increase performance of string operations
- open-telemetry/sdk-configuration: File-based OpenTelemetry SDK configuration
- 2.x-dev
- 1.5.0
- 1.4.0
- 1.3.0
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.1.0beta3
- 1.1.0beta2
- 1.1.0beta1
- dev-main / 1.0.x-dev
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 1.0.0RC2
- 1.0.0RC1
- 1.0.0beta17
- 1.0.0beta16
- 1.0.0beta15
- 1.0.0beta14
- 1.0.0beta13
- 1.0.0beta12
- 1.0.0beta11
- 1.0.0beta10
- 1.0.0beta9
- 1.0.0beta8
- 1.0.0beta7
- 1.0.0beta6
- 1.0.0beta5
- 1.0.0beta4
- 1.0.0beta3
- 1.0.0beta2
- 1.0.0beta1
- 0.0.17
- 0.0.16
- 0.0.15
- 0.0.14
- 0.0.13
- 0.0.12
- 0.0.11
- 0.0.10
- 0.0.9
- 0.0.8
- 0.0.7
- 0.0.6
- 0.0.5
This package is auto-updated.
Last update: 2025-05-22 02:43:24 UTC
README
OpenTelemetry SDK
The OpenTelemetry PHP SDK implements the API, and should be used in conjunction with contributed exporter(s) to generate and export telemetry.
Documentation
https://opentelemetry.io/docs/instrumentation/php/sdk/
Getting started
Manual setup
SDK Builder
Autoloading
SDK autoloading works with configuration values provided via the environment (or php.ini).
The SDK can be automatically created and registered, if the following conditions are met:
OTEL_PHP_AUTOLOAD_ENABLED=true
- all required SDK configuration is provided
SDK autoloading will be attempted as part of composer's autoloader:
require 'vendor/autoload.php'; $tracer = \OpenTelemetry\API\Globals::tracerProvider()->getTracer('example'); $meter = \OpenTelemetry\API\Globals::meterProvider()->getMeter('example');
If autoloading was not successful (or partially successful), no-op implementations of the above may be returned.
See https://github.com/open-telemetry/opentelemetry-php/blob/main/examples/autoload_sdk.php for a more detailed example.
Contributing
This repository is a read-only git subtree split. To contribute, please see the main OpenTelemetry PHP monorepo.