-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect encoding for traceId and spanId in OTLP JSON body #1059
Comments
Hi @mkaisercross |
Hi @brettmc. Ok I set in my composer.json file the following:
That resulted in these version in composer.lock
Unfortunately now I am getting a runtime exception.
|
To do otlp exporting (via http or grpc), you need to provide one of |
Ok yeah installing google/protobuf solved the issue for me and I can see the traceId and spanId have the correct format now. Thanks! |
Describe your environment
PHP 8.1.16 (cli) (built: Feb 14 2023 18:59:41) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.16, Copyright (c) Zend Technologies
with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethans
From my composer.json file
Steps to reproduce
What is the expected behavior?
Currently the OpenTelemetry\Contrib\Oltp classes are producing JSON that is not conforming to the standard. The traceId and spanId are not the correct encoding/length. It looks like they are base64 encoding but they should be base16 (aka hex). See evidence in links below.
OTLP Repo Trace Example
OTLP Repo Spec
OTLP Docs Spec
What is the actual behavior?
Here is a simplified version of the JSON I was able to dump from $payload argument in the 'vendor/open-telemetry/sdk/Common/Export/Http/PsrTransport.php::send() function. As you can see the length of traceId and spanId are 24 and 12 characters. These should be 32 and 16 characters for base16 encoding of 16 and 8 bytes as is defined by the specification.
Additional context
Additionally when I try to send the above JSON to grafana tempo for example I get back the following:
The text was updated successfully, but these errors were encountered: