uru / opentelemetry-auto-bitrix-component
OpenTelemetry auto-instrumentation for Bitrix Framework.
0.0.6
2024-12-03 19:16 UTC
Requires
- php: ^8.0
- ext-opentelemetry: *
- ext-reflection: *
- open-telemetry/api: ^1.0
- open-telemetry/sem-conv: ^1.24
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3
- open-telemetry/sdk: ^1.0
- phpstan/phpstan: ^1.1
README
OpenTelemetry Bitrix Framework auto-instrumentation
Overview
Auto-instrumentation hooks are registered via composer, and spans will automatically be created for:
\CBitrixComponent::executeComponent()
- root span
Install
install via composer
composer require uru/opentelemetry-auto-bitrix-component
Extend
You can extent Bitrix standard component class by adding additional method getRequest
this code example:
use Bitrix\Main\HttpRequest; use Bitrix\Main\Request; public function getRequest(): Request|HttpRequest { return $this->request; }
Also you can implement src/BitrixComponentInterface.php
interface for compatibility or extend src/BaseComponent.php
class in your components classes.
Configuration
The extension can be disabled via runtime configuration:
OTEL_PHP_DISABLED_INSTRUMENTATIONS=bitrix.component
For enabling support legacy attributes for exporters such Azure Monitor
OTEL_BITRIX_INSTRUMENTATION_LEGACY_SUPPORT=true