Skip to content

RandomIdGenerator can generate invalid Span/Trace Ids #3921

@sfc-gh-bdrutu

Description

@sfc-gh-bdrutu

Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on main.
latest

Steps to reproduce
You need to be very "lucky" to do so, but call billions of times generate_span_id until you get a ZERO value. Same issue may happen for generate_trace_id

What is the expected behavior?
Never receive an invalid Span/Trace ID from the generator (ZERO value).

What is the actual behavior?
Invalid IDs may happen.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions