You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
yahorsi
changed the title
SDK Thrown Unhandled Exception is OTEL Collector is not available
SDK Thrown Unhandled Exception is OTEL Collector if not available
Dec 5, 2024
Hi @yahorsi are you certain that it crashed the app? The export failure exception has been captured and logged (and you can configure where the logs go)
I updated one of our example scripts here to use batch span processor, and it seems to me to behave correctly:
# php examples/traces/exporters/otlp_http.php
Starting OTLP example
OTLP example complete!
OpenTelemetry: [error] Export failure [exception] Export retry limit exceeded [previous] cURL error 6: Could not resolve host: collector (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://collector:4318/v1/traces
#0 /usr/src/myapp/src/Contrib/Otlp/SpanExporter.php(38): OpenTelemetry\SDK\Common\Export\Http\PsrTransport->send('\n\x98\r\n\x9E\x06\n\e\n\thost....', NULL)#1 /usr/src/myapp/src/SDK/Trace/SpanProcessor/BatchSpanProcessor.php(247): OpenTelemetry\Contrib\Otlp\SpanExporter->export(Array)#2 /usr/src/myapp/src/SDK/Trace/SpanProcessor/BatchSpanProcessor.php(190): OpenTelemetry\SDK\Trace\SpanProcessor\BatchSpanProcessor->flush('shutdown', NULL)#3 /usr/src/myapp/src/SDK/Trace/TracerSharedState.php(71): OpenTelemetry\SDK\Trace\SpanProcessor\BatchSpanProcessor->shutdown(NULL)#4 /usr/src/myapp/src/SDK/Trace/TracerProvider.php(98): OpenTelemetry\SDK\Trace\TracerSharedState->shutdown(NULL)#5 /usr/src/myapp/examples/traces/exporters/otlp_http.php(53): OpenTelemetry\SDK\Trace\TracerProvider->shutdown()#6 {main}# echo $?
0
The return code from CLI is 0 (success). If you change the log destination, for example dropping putenv('OTEL_PHP_LOG_DESTINATION=none'); into your code, it should suppress the logging of errors. Does that change what you see in terms of crash/not?
Steps to reproduce
Start Open Telemetry instrumented app while OTEL Collector is not available, app cannot start
What is the expected behavior?
App does not crash
What is the actual behavior?
App crashes
The text was updated successfully, but these errors were encountered: