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

bugfix: RandomIdGenerator can generate invalid Span/Trace Ids #3949

Merged
merged 9 commits into from
Jun 13, 2024

Conversation

Charlie-lizhihan
Copy link
Contributor

@Charlie-lizhihan Charlie-lizhihan commented Jun 4, 2024

Description

This PR updates the RandomIdGenerator class to ensure that it generates valid span and trace IDs by avoiding specific invalid values.

Fixes #3921

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

I wrote 2 new tests for this one, when it generate a invalid id(for example: 0), the generate function will run again.

  • tox -e py38-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@Charlie-lizhihan Charlie-lizhihan requested a review from a team as a code owner June 4, 2024 13:54
Copy link

linux-foundation-easycla bot commented Jun 4, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

CHANGELOG.md Outdated Show resolved Hide resolved
correct the PR id
@Charlie-lizhihan Charlie-lizhihan changed the title bugfix: RandomIdGenerator can generate invalid Span/Trace Ids #3921 bugfix: RandomIdGenerator can generate invalid Span/Trace Ids Jun 4, 2024
Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

Lint job is failing. I suggest you setup pre-commit which can help avoid that. See CONTRIBUTING.md

@lzchen lzchen merged commit d0bde24 into open-telemetry:main Jun 13, 2024
269 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RandomIdGenerator can generate invalid Span/Trace Ids
3 participants