open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
752 stars 186 forks source link

OpenTelemetry: [error] Export failure [exception] Unprocessable Entity [previous] #1405

Closed cmnemoi closed 1 week ago

cmnemoi commented 1 month ago

Describe your environment PHP 8.3.12, open-telemetry/api 1.1.0, open-telemetry/context 1.1.0, open-telemetry/exporter-otlp 1.1.0, open-telemetry/sdk 1.1.0, open-telemetry/sem-conv 1.27.1 PHP runs inside a Docker container

Steps to reproduce Launching this project on the following branch : https://gitlab.com/eternaltwin/mush/mush/-/tree/internal/otel

What is the expected behavior? I expect to see OpenTelemetry traces sent through my OLTP endpoint

What is the actual behavior? I see this error:

mush_php       | NOTICE: PHP message: OpenTelemetry: [error] Export failure [exception] Unprocessable Entity [previous] 
mush_php       | #0 /www/vendor/open-telemetry/exporter-otlp/SpanExporter.php(38): OpenTelemetry\SDK\Common\Export\Http\PsrTransport->send('\n\xEA\x03\n?\n\x17\n\fservic...', NULL)
mush_php       | #1 /www/vendor/open-telemetry/sdk/Trace/SpanProcessor/SimpleSpanProcessor.php(51): OpenTelemetry\Contrib\Otlp\SpanExporter->export(Array)
mush_php       | #2 /www/vendor/open-telemetry/sdk/Trace/SpanProcessor/SimpleSpanProcessor.php(92): OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor->OpenTelemetry\SDK\Trace\SpanProcessor\{closure}()
mush_php       | #3 /www/vendor/open-telemetry/sdk/Trace/SpanProcessor/SimpleSpanProcessor.php(51): OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor->flush(Object(Closure), 'export', false, Object(OpenTelemetry\Context\Context))
mush_php       | #4 /www/vendor/open-telemetry/sdk/Trace/Span.php(259): OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor->onEnd(Object(OpenTelemetry\SDK\Trace\Span))
mush_php       | #5 /www/public/index.php(43): OpenTelemetry\SDK\Trace\Span->end()
mush_php       | #6 {main}

Additional context Here is some relevant code :

brettmc commented 1 month ago

I think that's a 422 response from the opentelemetry collector (or whichever service you are sending telemetry to). Is anything logged upstream if you dial up the logging?

ChrisLightfootWild commented 1 month ago

@cmnemoi have you had any time to look further into this?

cmnemoi commented 1 week ago

Sorry for the delay,

I had time to work on this again, and after updating my opentelemetry dependencies, it works again.

I am therefore closing the issue.

Regards,