open-telemetry / opentelemetry-auto-curl
OpenTelemetry auto-instrumentation for curl
Requires
- php: ^8.2
- ext-curl: *
- ext-opentelemetry: *
- open-telemetry/api: ^1.0
- open-telemetry/sem-conv: ^1.24
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- open-telemetry/sdk: ^1.0
- phan/phan: ^5.0
- php-http/mock-client: *
- phpstan/phpstan: ^1.1
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- psalm/plugin-phpunit: ^0.18.4
- vimeo/psalm: ^5.0
This package is auto-updated.
Last update: 2024-10-30 13:06:12 UTC
README
This is a read-only subtree split of https://github.com/open-telemetry/opentelemetry-php-contrib.
OpenTelemetry curl auto-instrumentation
Please read https://opentelemetry.io/docs/instrumentation/php/automatic/ for instructions on how to install and configure the extension and SDK.
Overview
Auto-instrumentation hooks are registered via composer, and client kind spans will automatically be created when calling curl_exec
or curl_multi_exec
functions.
Limitations
The curl_multi instrumentation is not resilient to shortcomings in the application and requires proper implementation. If the application does not call the curl_multi_info_read function, the instrumentation will be unable to measure the execution time for individual requests-time will be aggregated for all transfers. Similarly, error detection will be impacted, as the error code information will be missing in this case. In case of encountered issues, it is recommended to review the application code and adjust it to match example #1 provided in curl_multi_exec documentation.
Configuration
The extension can be disabled via runtime configuration:
OTEL_PHP_DISABLED_INSTRUMENTATIONS=curl