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

The implementation of Trace ID is incompatible with the spec #1991

Closed
ymotongpoo opened this issue Jul 27, 2021 · 1 comment · Fixed by #1992
Closed

The implementation of Trace ID is incompatible with the spec #1991

ymotongpoo opened this issue Jul 27, 2021 · 1 comment · Fixed by #1992
Labels
bug Something isn't working

Comments

@ymotongpoo
Copy link
Contributor

ymotongpoo commented Jul 27, 2021

Describe your environment

  • OS: Linux (Debian 10)
  • Python: 3.9.2 (vanilla)

Steps to reproduce

  1. Read the spec of Trace ID
  2. Read the implementation of Trace ID in SpanContext

What is the expected behavior?
Trace ID in OpenTelemetry for Python is defined as "16-bytes bytes" which is following OpenTelemetry's spec

What is the actual behavior?
Trace ID is just defined as int and there is no validation for the length of the ID in the SpanContext constructor.

Additional context
If we make OpenTelemetry for Python follow the existing spec as-is, it may be braking changes for existing libraries including 1st party and 3rd parties.

Some other languages are validating the length of data:

@ymotongpoo ymotongpoo added the bug Something isn't working label Jul 27, 2021
@ocelotl
Copy link
Contributor

ocelotl commented Jul 27, 2021

We actually do have 128-bit randomly generated trace ids. Is the issue here that we don't check that a trace is not greater than 2 **128 - 1?

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

Successfully merging a pull request may close this issue.

2 participants