Make a soft dependency for the ExceptionTraceEventSubscriber

Created on 10 October 2023, about 1 year ago

Problem/Motivation

We have a dependency on the opentelemetry service in ExceptionTraceEventSubscriber, so if we get an exception in the opentelemetry service initialization, we have a circular reference problem:

The website encountered an unexpected error. Please try again later.
Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException: Circular reference detected for service "opentelemetry", path: "Drupal\opentelemetry\EventSubscriber\RequestTraceEventSubscriber -> opentelemetry -> OpenTelemetry\SDK\Trace\TracerProvider -> OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor -> OpenTelemetry\Contrib\Otlp\SpanExporter -> Drupal\opentelemetry\EventSubscriber\ExceptionTraceEventSubscriber". in Drupal\Component\DependencyInjection\Container->get() (line 147 of core/lib/Drupal/Component/DependencyInjection/Container.php).

Steps to reproduce

Proposed resolution

To resolve this problem will be good to remove the opentelemetry service from the dependencies of ExceptionTraceEventSubscriber and load it on demand.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇦🇲Armenia murz Yerevan, Armenia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024