Avoid error when just installing

Created on 9 December 2024, about 1 month ago

Problem/Motivation

Right now, just installing the module immediately results in an error if you don't have opentelemetry running on the default port:

$ ddev drush en opentelemetry_metrics
The following module(s) will be enabled: opentelemetry_metrics, opentelemetry

 Do you want to continue? (yes/no) [yes]:
 > 

 [success] Successfully enabled: opentelemetry_metrics, opentelemetry
 [error]  Export failure: Export retry limit exceeded in line 97 of /var/www/html/vendor/open-telemetry/sdk/Common/Export/Http/PsrTransport.php (previous exception message: cURL error 7: Failed to connect to localhost port 4318 after 0 ms: Couldn't connect to server (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://localhost:4318/v1/traces). <pre>#0 /var/www/html/vendor/open-telemetry/exporter-otlp/SpanExporter.php(38): OpenTelemetry\SDK\Common\Export\Http\PsrTransport->send()
#1 /var/www/html/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php(247): OpenTelemetry\Contrib\Otlp\SpanExporter->export()
#2 /var/www/html/vendor/open-telemetry/sdk/Trace/SpanProcessor/BatchSpanProcessor.php(179): OpenTelemetry\SDK\Trace\SpanProcessor\BatchSpanProcessor->flush()
#3 /var/www/html/vendor/open-telemetry/sdk/Trace/TracerProvider.php(57): OpenTelemetry\SDK\Trace\SpanProcessor\BatchSpanProcessor->forceFlush()
#4 /var/www/html/web/modules/contrib/opentelemetry/src/OpentelemetryService.php(357): OpenTelemetry\SDK\Trace\TracerProvider->forceFlush()
#5 /var/www/html/web/modules/contrib/opentelemetry/src/OpentelemetryService.php(344): Drupal\opentelemetry\OpentelemetryService->finalize()
#6 [internal function]: Drupal\opentelemetry\OpentelemetryService->onTerminate()
#7 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(115): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#9 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(66): Symfony\Component\HttpKernel\HttpKernel->terminate()
#10 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate()
#11 /var/www/html/vendor/drush/drush/src/Boot/DrupalBoot8.php(308): Drupal\Core\DrupalKernel->terminate()
#12 [internal function]: Drush\Boot\DrupalBoot8->terminate()
#13 {main}</pre> 

Steps to reproduce

Proposed resolution

Maybe don't have a default setting for the endpoint? Or don't enable any features by default and instead, add the configure URL to the .info.yml.

Drush will now automatically display that as a clickable link.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇨🇭Switzerland berdir Switzerland

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024