uru/opentelemetry-auto-bitrix-component

OpenTelemetry auto-instrumentation for Bitrix Framework.

0.0.6 2024-12-03 19:16 UTC

This package is auto-updated.

Last update: 2024-12-03 19:18:17 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

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