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

Span and trace IDs should not be zero #2113

Merged
merged 3 commits into from
Jun 28, 2022
Merged

Conversation

albertvaka
Copy link
Contributor

What does this PR do?
Fix a TODO by making sure span and trace IDs are greater than zero.

Motivation
The Agent drops IDs == 0, in the unlikely case random returns zero we would drop that span/trace.

The Agent drops IDs == 0.
@albertvaka albertvaka requested a review from a team June 28, 2022 13:32
@marcotc marcotc added bug Involves a bug labels Jun 28, 2022
Copy link
Member

@marcotc marcotc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @albertvaka! Looks good 👍.
I've made a small change, moving the range 1..MAX to a constant, to avoid a new Range object creation on every invocation of next_id.

@marcotc marcotc merged commit d96ee54 into master Jun 28, 2022
@marcotc marcotc deleted the albertvaka/rand-ids-not-zero branch June 28, 2022 21:23
@github-actions github-actions bot added this to the 1.2.0 milestone Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Involves a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants