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
# Description
Fix#5462
## Type of change
add a loop to generate the spanID and traceID.
the loop will not stop until it generate a valid ID
- [x] Bug fix (non-breaking change which fixes an issue)
---------
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
# Description
Fixopen-telemetry#5462
## Type of change
add a loop to generate the spanID and traceID.
the loop will not stop until it generate a valid ID
- [x] Bug fix (non-breaking change which fixes an issue)
---------
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Description
The spec (https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md) mentions that TraceId and SpanId must have at least one non-zero byte. However, the default id generator doesn't ensure that (https://github.com/open-telemetry/opentelemetry-go/blob/main/sdk/trace/id_generator.go#L44). The generator simply uses rand.Read() which does not guarantee non-zero output.
Environment
All environments
Steps To Reproduce
Difficult to give exact steps to reproduce, as random number generation is involved.
Expected behavior
Generated TraceId and SpanId must always be non-zero as per spec.
The text was updated successfully, but these errors were encountered: