Skip to content
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

OTLP exporter is encoding invalid span/trace IDs in the logs #3828

Closed
yurishkuro opened this issue Apr 2, 2024 · 0 comments · Fixed by #4006
Closed

OTLP exporter is encoding invalid span/trace IDs in the logs #3828

yurishkuro opened this issue Apr 2, 2024 · 0 comments · Fixed by #4006
Labels
bug Something isn't working logging

Comments

@yurishkuro
Copy link
Member

yurishkuro commented Apr 2, 2024

Describe your environment
Using v1.23.0, configured OTLP HTTP exporter for logs

Steps to reproduce
Running a sample code that roughly looks like https://github.com/open-telemetry/opentelemetry-python/blob/main/docs/examples/logs/example.py

What is the expected behavior?
When there is no active trace, the exporter should not be including trace/span IDs into Protobuf messages

What is the actual behavior?
When I serialize received protobuf to JSON it looks like this:

              "traceId": "AAAAAAAAAAAAAAAAAAAAAA==",
              "spanId": "AAAAAAAAAAA="

That means the exporter is sending 00....00 bytes as trace and span IDs. The zero values indicate invalid trace/span ID, and the fields in the protobuf are optional, so the right behavior would be to not include these fields in the output. This will also minimize the size of the exported messages.

If maintainers agree with this, I can create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working logging
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants